From adc05e6ce6c535b2dcc218e0486dd6298f5c7ba8 Mon Sep 17 00:00:00 2001 From: Jeffrey A Law Date: Sun, 5 Jul 1998 23:20:51 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 3 +++ gcc/combine.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e91a7e08cc8..8e9c2e4c42b 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 a0c78648c31..a299fb098ec 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)))) -- 2.30.2