aboutsummaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2000-09-11 22:20:32 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2000-09-11 22:20:32 +0200
commit6ff85fd82d366db03289da8f6b47e202eb4eee7b (patch)
tree90cccff7b1e490cd93a4558a51852a30f3faaae4 /gcc/simplify-rtx.c
parent4102c782e32436af07666c512e1fbf2a3404cc18 (diff)
downloadgcc-6ff85fd82d366db03289da8f6b47e202eb4eee7b.zip
gcc-6ff85fd82d366db03289da8f6b47e202eb4eee7b.tar.gz
gcc-6ff85fd82d366db03289da8f6b47e202eb4eee7b.tar.bz2
combine.c (simplify_if_then_else): Don't convert a == b ? b ...
* 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. From-SVN: r36326
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 701b7ba..0091d72 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;