[backport gcc-4.8/trunk r193111 ] gcc/ 2012-11-02 Andrew Pinski PR rtl-opt/54524 * simplify-rtx.c (simplify_relational_operation_1): Don't simplify (LTU/GEU (PLUS a 0) 0) into (GEU/LTU a 0) since they are not equivalent. --- gcc-4.7.2/gcc/simplify-rtx.c.~1~ 2012-08-06 16:34:27.000000000 +0200 +++ gcc-4.7.2/gcc/simplify-rtx.c 2012-11-03 16:31:40.000000000 +0100 @@ -4283,7 +4283,9 @@ simplify_relational_operation_1 (enum rt && GET_CODE (op0) == PLUS && CONST_INT_P (XEXP (op0, 1)) && (rtx_equal_p (op1, XEXP (op0, 0)) - || rtx_equal_p (op1, XEXP (op0, 1)))) + || rtx_equal_p (op1, XEXP (op0, 1))) + /* (LTU/GEU (PLUS a 0) 0) is not the same as (GEU/LTU a 0). */ + && XEXP (op0, 1) != const0_rtx) { rtx new_cmp = simplify_gen_unary (NEG, cmp_mode, XEXP (op0, 1), cmp_mode);