diff options
| author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-11 20:20:32 +0000 |
|---|---|---|
| committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-11 20:20:32 +0000 |
| commit | bddce4a03d1cc997bedcf04bd0e6e58b6567fa4b (patch) | |
| tree | 90cccff7b1e490cd93a4558a51852a30f3faaae4 | |
| parent | d59c9e2830b0efcc5d4fee822e52c8fee1491b93 (diff) | |
| download | ppe42-gcc-bddce4a03d1cc997bedcf04bd0e6e58b6567fa4b.tar.gz ppe42-gcc-bddce4a03d1cc997bedcf04bd0e6e58b6567fa4b.zip | |
* combine.c (simplify_if_then_else): Don't convert a == b ? b : a
to a if the comparison is floating mode and not -ffast-math.
* simplify-rtx.c (simplify_ternary_operation): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36326 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/combine.c | 2 | ||||
| -rw-r--r-- | gcc/simplify-rtx.c | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0aa4fd4b860..dd8593e88a1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2000-09-11 Jakub Jelinek <jakub@redhat.com> + + * combine.c (simplify_if_then_else): Don't convert a == b ? b : a + to a if the comparison is floating mode and not -ffast-math. + * simplify-rtx.c (simplify_ternary_operation): Likewise. + Mon Sep 11 20:07:48 2000 J"orn Rennecke <amylaar@redhat.co.uk> * sh.h (INITIALIZE_TRAMPOLINE): Remove stray call to diff --git a/gcc/combine.c b/gcc/combine.c index 053b42060ce..478aab2b2a3 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -4703,10 +4703,12 @@ simplify_if_then_else (x) /* Convert a == b ? b : a to "a". */ if (true_code == EQ && ! side_effects_p (cond) + && (! FLOAT_MODE_P (mode) || flag_fast_math) && rtx_equal_p (XEXP (cond, 0), false) && rtx_equal_p (XEXP (cond, 1), true)) return false; else if (true_code == NE && ! side_effects_p (cond) + && (! FLOAT_MODE_P (mode) || flag_fast_math) && rtx_equal_p (XEXP (cond, 0), true) && rtx_equal_p (XEXP (cond, 1), false)) return true; diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 701b7ba1721..0091d727092 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -1976,10 +1976,12 @@ simplify_ternary_operation (code, mode, op0_mode, op0, op1, op2) /* Convert a == b ? b : a to "a". */ if (GET_CODE (op0) == NE && ! side_effects_p (op0) + && (! FLOAT_MODE_P (mode) || flag_fast_math) && rtx_equal_p (XEXP (op0, 0), op1) && rtx_equal_p (XEXP (op0, 1), op2)) return op1; else if (GET_CODE (op0) == EQ && ! side_effects_p (op0) + && (! FLOAT_MODE_P (mode) || flag_fast_math) && rtx_equal_p (XEXP (op0, 1), op1) && rtx_equal_p (XEXP (op0, 0), op2)) return op2; |

