summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-27 17:26:03 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-27 17:26:03 +0000
commit17af021d4a17197944da70f467be5b91c7811db2 (patch)
tree01eecbf4b1eac9e56e4638fc994d61e6c1f26336
parent0ed224e1a25911354a1680f0eb50f04523437fd6 (diff)
downloadppe42-gcc-17af021d4a17197944da70f467be5b91c7811db2.tar.gz
ppe42-gcc-17af021d4a17197944da70f467be5b91c7811db2.zip
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113318 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/expmed.c7
2 files changed, 12 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0ca0fcfb721..940f0df3159 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2006-04-27 Roger Sayle <roger@eyesopen.com>
+
+ * 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.
+
2006-04-27 Richard Guenther <rguenther@suse.de>
PR rtl-optimization/26685
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 5a32366cc64..89ae78df7cd 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;
OpenPOWER on IntegriCloud