diff options
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 6c24caa..0e556db 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -10362,8 +10362,12 @@ simplify_comparison (code, pop0, pop1) & ~ (mask >> (INTVAL (XEXP (op0, 1)) + ! equality_comparison_p))) == 0) { - const_op >>= INTVAL (XEXP (op0, 1)); - op1 = GEN_INT (const_op); + /* We must perform a logical shift, not an arithmetic one, + as we want the top N bits of C to be zero. */ + unsigned HOST_WIDE_INT temp = const_op; + + temp >>= INTVAL (XEXP (op0, 1)); + op1 = GEN_INT (temp); op0 = XEXP (op0, 0); continue; } |