re PR rtl-optimization/54524 (Spurious add on sum of bitshifts (forward-propagate...
authorAndrew Pinski <apinski@cavium.com>
Fri, 2 Nov 2012 23:32:32 +0000 (23:32 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Fri, 2 Nov 2012 23:32:32 +0000 (16:32 -0700)
2012-11-02  Andrew Pinski  <apinski@cavium.com>

        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.

From-SVN: r193111

gcc/ChangeLog
gcc/simplify-rtx.c

index 284dd8a152036b52ec3e0608254b3f5a14ae6c4c..ada7ff5e78674d2b56e990e05ab72be8f7ac79c3 100644 (file)
@@ -1,3 +1,9 @@
+2012-11-02  Andrew Pinski  <apinski@cavium.com>
+
+       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.
+
 2012-11-02  Jan Hubicka  <jh@suse.cz>
 
        * tree-ssa-loop-niter.c (double_int_cmp, bound_index,
index cb63b80500e52296716644f208272b997e130f25..6c50d301fe06027bfa4aac1eb397f1766bb32886 100644 (file)
@@ -4546,7 +4546,9 @@ simplify_relational_operation_1 (enum rtx_code code, enum machine_mode mode,
       && 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);