]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/34627 (Incorrect branching with -Ox on hppa)
authorSteven Bosscher <stevenb.gcc@gmail.com>
Sat, 9 Feb 2008 00:34:19 +0000 (00:34 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sat, 9 Feb 2008 00:34:19 +0000 (00:34 +0000)
PR middle-end/34627
combine.c (simplify_if_then_else): Make sure the comparison is
against const0_rtx when simplifying to (abs x) or (neg (abs X)).

From-SVN: r132194

gcc/ChangeLog
gcc/combine.c

index bddf890f8e1618c3d5ebd060957a18afeefab1fc..69b85f221ff5272227ae913a50c1ed02e1871131 100644 (file)
@@ -1,3 +1,9 @@
+2008-02-08  Steven Bosscher  <stevenb.gcc@gmail.com>
+
+       PR middle-end/34627
+       combine.c (simplify_if_then_else): Make sure the comparison is
+       against const0_rtx when simplifying to (abs x) or (neg (abs X)).
+
 2008-07-07  Richard Henderson  <rth@redhat.com>
 
        PR rtl-opt/33410
index 1c7f1d4cb052790f81b5831edfec80097c58fc44..4667b236461f431bf18c8d75d9abdd4c45446f08 100644 (file)
@@ -4968,9 +4968,10 @@ simplify_if_then_else (rtx x)
   /* Look for cases where we have (abs x) or (neg (abs X)).  */
 
   if (GET_MODE_CLASS (mode) == MODE_INT
+      && comparison_p
+      && XEXP (cond, 1) == const0_rtx
       && GET_CODE (false_rtx) == NEG
       && rtx_equal_p (true_rtx, XEXP (false_rtx, 0))
-      && comparison_p
       && rtx_equal_p (true_rtx, XEXP (cond, 0))
       && ! side_effects_p (true_rtx))
     switch (true_code)