diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8e7d40ddc2c..785fd26a28f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-01-14 Geoffrey Keating + + * combine.c (simplify_comparison): Don't change `code' when + can't reverse comparison. + 2001-01-14 Richard Henderson * rtlanal.c (computed_jump_p_1): Rename from jmp_uses_reg_or_mem; diff --git a/gcc/combine.c b/gcc/combine.c index 055cfc353f0..30b13c8d692 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -10710,13 +10710,19 @@ simplify_comparison (code, pop0, pop1) && (STORE_FLAG_VALUE & (((HOST_WIDE_INT) 1 << (GET_MODE_BITSIZE (GET_MODE (op0)) - 1)))) - && (code == LT || (code == GE)))) + && (code == LT || code == GE))) { - code = (code == LT || code == NE - ? GET_CODE (op0) : combine_reversed_comparison_code (op0)); - if (code != UNKNOWN) + enum rtx_code new_code; + if (code == LT || code == NE) + new_code = GET_CODE (op0); + else + new_code = combine_reversed_comparison_code (op0); + + if (new_code != UNKNOWN) { - op0 = tem, op1 = tem1; + code = new_code; + op0 = tem; + op1 = tem1; continue; } }