From 145d3bf292a6cfc66a6396285003765db9424a8f Mon Sep 17 00:00:00 2001 From: Richard Earnshaw Date: Thu, 7 Mar 2002 10:39:50 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 5 +++++ gcc/combine.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 555d2ff1d05..6def6705e0b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-03-07 Richard Earnshaw + + * combine.c (simplify_comparison): If simplifying a logical shift + right and compare with constant, force the comparison to unsigned. + 2002-03-07 Aldy Hernandez * doc/invoke.texi: Add documentation for -mabi=no-altivec. diff --git a/gcc/combine.c b/gcc/combine.c index 733ce27ee2f..a155555c5fc 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); -- 2.30.2