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

gcc/ChangeLog
gcc/combine.c

index adb51bcbc9e063d9e224375fea34512659ce689a..5d140fe532eb5e09478893727a1dffb8538dd6d3 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-04  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/33631
index 87499445d091cb15c306cc1e532dbb291cc3a7e9..7a732657fedbc840aab6aabc89965f08ea71cfdd 100644 (file)
@@ -5067,9 +5067,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)