aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2002-03-07 10:39:50 +0000
committerRichard Earnshaw <rearnsha@gcc.gnu.org>2002-03-07 10:39:50 +0000
commit145d3bf292a6cfc66a6396285003765db9424a8f (patch)
tree8c0ed81874619fdf665ae27cb2b965066b1df37d /gcc/combine.c
parent50cb1e208d8e7f3f23819f3a70ba9c7c3a806fac (diff)
downloadgcc-145d3bf292a6cfc66a6396285003765db9424a8f.zip
gcc-145d3bf292a6cfc66a6396285003765db9424a8f.tar.gz
gcc-145d3bf292a6cfc66a6396285003765db9424a8f.tar.bz2
combine.c (simplify_comparison): If simplifying a logical shift right and compare with constant...
* combine.c (simplify_comparison): If simplifying a logical shift right and compare with constant, force the comparison to unsigned. From-SVN: r50400
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 733ce27..a155555 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -10885,6 +10885,11 @@ simplify_comparison (code, pop0, pop1)
|| (floor_log2 (const_op) + INTVAL (XEXP (op0, 1))
< mode_width)))
{
+ /* If the shift was logical, then we must make the condition
+ unsigned. */
+ if (GET_CODE (op0) == LSHIFTRT)
+ code = unsigned_condition (code);
+
const_op <<= INTVAL (XEXP (op0, 1));
op1 = GEN_INT (const_op);
op0 = XEXP (op0, 0);