aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.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/combine.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/combine.c')
-rw-r--r--gcc/combine.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 053b420..478aab2 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;