]> 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:30:13 +0000 (00:30 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sat, 9 Feb 2008 00:30:13 +0000 (00:30 +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: r132193

gcc/ChangeLog
gcc/combine.c

index 910417b73f12ccfd8f79b775f66fac7107cac84d..918ff4b802686aa133838261b39b0f0dbd856367 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-02-08  Richard Sandiford  <rsandifo@nildram.co.uk>
 
        PR bootstrap/35051
index 5cfa3051b0d92e1dc3aa8b0807a186efa3d95b38..b812b33ac41da965ed9c346bd1cf7f6cbf2ade58 100644 (file)
@@ -5393,9 +5393,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)