aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1998-07-05 23:20:51 +0000
committerJeff Law <law@gcc.gnu.org>1998-07-05 17:20:51 -0600
commitadc05e6ce6c535b2dcc218e0486dd6298f5c7ba8 (patch)
tree056a0913eaa34a61e6187fe35692e5edf7e3f130
parent80de1662849972bc92c9081a2baf8c2723ac27d9 (diff)
downloadgcc-adc05e6ce6c535b2dcc218e0486dd6298f5c7ba8.zip
gcc-adc05e6ce6c535b2dcc218e0486dd6298f5c7ba8.tar.gz
gcc-adc05e6ce6c535b2dcc218e0486dd6298f5c7ba8.tar.bz2
combine.c (simplify_comparison): Do not commute a AND into a paradoxical SUBREG if not WORD_REGISTER_OPERATIONS.
* combine.c (simplify_comparison): Do not commute a AND into a paradoxical SUBREG if not WORD_REGISTER_OPERATIONS. From-SVN: r20934
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/combine.c10
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e91a7e0..8e9c2e4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
Sun Jul 5 23:58:19 1998 Jeffrey A Law (law@cygnus.com)
+ * combine.c (simplify_comparison): Do not commute a AND into
+ a paradoxical SUBREG if not WORD_REGISTER_OPERATIONS.
+
* i386/freebsd-elf.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Protect with
HAVE_GAS_MAX_SKIP_P2ALIGN.
* i386/linux.h: Likewise.
diff --git a/gcc/combine.c b/gcc/combine.c
index a0c7864..a299fb0 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -10154,6 +10154,16 @@ simplify_comparison (code, pop0, pop1)
|| subreg_lowpart_p (XEXP (op0, 0))
#endif
)
+#ifndef WORD_REGISTER_OPERATIONS
+ /* It is unsafe to commute the AND into the SUBREG if the SUBREG
+ is paradoxical and WORD_REGISTER_OPERATIONS is not defined.
+ As originally written the upper bits have a defined value
+ due to the AND operation. However, if we commute the AND
+ inside the SUBREG then they no longer have defined values
+ and the meaning of the code has been changed. */
+ && (GET_MODE_SIZE (GET_MODE (XEXP (op0, 0)))
+ <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (XEXP (op0, 0)))))
+#endif
&& GET_CODE (XEXP (op0, 1)) == CONST_INT
&& mode_width <= HOST_BITS_PER_WIDE_INT
&& (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (XEXP (op0, 0))))