From: danglin Date: Sat, 9 Feb 2008 00:30:13 +0000 (+0000) Subject: PR middle-end/34627 X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=76d5115af59a7ff2ba8d4a0424239acdc70e5389;ds=sidebyside 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)). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132193 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 910417b73f1..918ff4b8026 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-02-08 Steven Bosscher + + 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 PR bootstrap/35051 diff --git a/gcc/combine.c b/gcc/combine.c index 5cfa3051b0d..b812b33ac41 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -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)