diff options
author | Steven Bosscher <stevenb.gcc@gmail.com> | 2008-02-09 00:30:13 +0000 |
---|---|---|
committer | John David Anglin <dave.anglin@nrc-cnrc.gc.ca> | 2008-02-09 00:30:13 +0000 |
commit | 060c958dbd00d2520660053393903e11aaf07641 (patch) | |
tree | 19f4088dad593151e91dea9b14493ce23ab72dc5 | |
parent | aca1c81a2e78be2786f6a22f569567b47dcd5fb7 (diff) |
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: https://gcc.gnu.org/svn/gcc/trunk@132193 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/combine.c | 3 |
2 files changed, 8 insertions, 1 deletions
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 <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 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) |