Commit 6ff85fd8 by Jakub Jelinek Committed by Jakub Jelinek

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
parent 4102c782
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> Mon Sep 11 20:07:48 2000 J"orn Rennecke <amylaar@redhat.co.uk>
* sh.h (INITIALIZE_TRAMPOLINE): Remove stray call to * sh.h (INITIALIZE_TRAMPOLINE): Remove stray call to
......
...@@ -4703,10 +4703,12 @@ simplify_if_then_else (x) ...@@ -4703,10 +4703,12 @@ simplify_if_then_else (x)
/* Convert a == b ? b : a to "a". */ /* Convert a == b ? b : a to "a". */
if (true_code == EQ && ! side_effects_p (cond) 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, 0), false)
&& rtx_equal_p (XEXP (cond, 1), true)) && rtx_equal_p (XEXP (cond, 1), true))
return false; return false;
else if (true_code == NE && ! side_effects_p (cond) 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, 0), true)
&& rtx_equal_p (XEXP (cond, 1), false)) && rtx_equal_p (XEXP (cond, 1), false))
return true; return true;
......
...@@ -1976,10 +1976,12 @@ simplify_ternary_operation (code, mode, op0_mode, op0, op1, op2) ...@@ -1976,10 +1976,12 @@ simplify_ternary_operation (code, mode, op0_mode, op0, op1, op2)
/* Convert a == b ? b : a to "a". */ /* Convert a == b ? b : a to "a". */
if (GET_CODE (op0) == NE && ! side_effects_p (op0) 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, 0), op1)
&& rtx_equal_p (XEXP (op0, 1), op2)) && rtx_equal_p (XEXP (op0, 1), op2))
return op1; return op1;
else if (GET_CODE (op0) == EQ && ! side_effects_p (op0) 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, 1), op1)
&& rtx_equal_p (XEXP (op0, 0), op2)) && rtx_equal_p (XEXP (op0, 0), op2))
return op2; return op2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment