diff options
author | Steven Bosscher <stevenb.gcc@gmail.com> | 2008-02-09 00:30:13 +0000 |
---|---|---|
committer | John David Anglin <danglin@gcc.gnu.org> | 2008-02-09 00:30:13 +0000 |
commit | e37f6a497d5c1c0489f3fac12884f9a71fdc7147 (patch) | |
tree | 19f4088dad593151e91dea9b14493ce23ab72dc5 /gcc | |
parent | 264940793b5f32b0ec420857940f80b23e159e78 (diff) | |
download | gcc-e37f6a497d5c1c0489f3fac12884f9a71fdc7147.zip gcc-e37f6a497d5c1c0489f3fac12884f9a71fdc7147.tar.gz gcc-e37f6a497d5c1c0489f3fac12884f9a71fdc7147.tar.bz2 |
re PR middle-end/34627 (Incorrect branching with -Ox on hppa)
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
Diffstat (limited to 'gcc')
-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 910417b..918ff4b 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 5cfa305..b812b33 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) |