OSDN Git Service

PR middle-end/34627
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 9 Feb 2008 00:30:13 +0000 (00:30 +0000)
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 9 Feb 2008 00:30:13 +0000 (00:30 +0000)
combine.c (simplify_if_then_else): Make sure the comparison is
against const0_rtx when simplifying to (abs x) or (neg (abs X)).

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132193 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/combine.c

index 910417b..918ff4b 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 5cfa305..b812b33 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)