aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2006-04-27 17:26:03 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2006-04-27 17:26:03 +0000
commit135c2bd4086d5e4d5a4cc24f9a7dc5ee7184eaa1 (patch)
tree01eecbf4b1eac9e56e4638fc994d61e6c1f26336 /gcc/expmed.c
parent921b02cd1f97018761f736753cf9a8d9a3227494 (diff)
downloadgcc-135c2bd4086d5e4d5a4cc24f9a7dc5ee7184eaa1.zip
gcc-135c2bd4086d5e4d5a4cc24f9a7dc5ee7184eaa1.tar.gz
gcc-135c2bd4086d5e4d5a4cc24f9a7dc5ee7184eaa1.tar.bz2
expmed.c (store_fixed_bit_field): If we're not optimizing for size...
* expmed.c (store_fixed_bit_field): If we're not optimizing for size, force the intermediate into a new pseudo rather instead of performing both a bitwise AND and a bitwise IOR in memory. From-SVN: r113318
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 5a32366..89ae78d 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -924,7 +924,12 @@ store_fixed_bit_field (rtx op0, unsigned HOST_WIDE_INT offset,
if (! all_one)
{
- temp = expand_binop (mode, and_optab, op0,
+ /* Don't try and keep the intermediate in memory, if we need to
+ perform both a bit-wise AND and a bit-wise IOR (except when
+ we're optimizing for size). */
+ if (MEM_P (subtarget) && !all_zero && !optimize_size)
+ subtarget = force_reg (mode, subtarget);
+ temp = expand_binop (mode, and_optab, subtarget,
mask_rtx (mode, bitpos, bitsize, 1),
subtarget, 1, OPTAB_LIB_WIDEN);
subtarget = temp;