Commit 5a3d4bef by Richard Kenner

(simplify_binary_operation...

(simplify_binary_operation, case MULT): When testing for
floating-point equality, make sure we do so inside a region protected
from traps.

From-SVN: r3963
parent 0b6b2900
...@@ -3565,15 +3565,23 @@ simplify_binary_operation (code, mode, op0, op1) ...@@ -3565,15 +3565,23 @@ simplify_binary_operation (code, mode, op0, op1)
&& GET_MODE_CLASS (GET_MODE (op1)) == MODE_FLOAT) && GET_MODE_CLASS (GET_MODE (op1)) == MODE_FLOAT)
{ {
REAL_VALUE_TYPE d; REAL_VALUE_TYPE d;
jmp_buf handler;
int op1is2, op1ism1;
if (setjmp (handler))
return 0;
set_float_handler (handler);
REAL_VALUE_FROM_CONST_DOUBLE (d, op1); REAL_VALUE_FROM_CONST_DOUBLE (d, op1);
op1is2 = REAL_VALUES_EQUAL (d, dconst2);
op1ism1 = REAL_VALUES_EQUAL (d, dconstm1);
set_float_handler (NULL_PTR);
/* x*2 is x+x and x*(-1) is -x */ /* x*2 is x+x and x*(-1) is -x */
if (REAL_VALUES_EQUAL (d, dconst2) if (op1is2 && GET_MODE (op0) == mode)
&& GET_MODE (op0) == mode)
return gen_rtx (PLUS, mode, op0, copy_rtx (op0)); return gen_rtx (PLUS, mode, op0, copy_rtx (op0));
else if (REAL_VALUES_EQUAL (d, dconstm1) else if (op1ism1 && GET_MODE (op0) == mode)
&& GET_MODE (op0) == mode)
return gen_rtx (NEG, mode, op0); return gen_rtx (NEG, mode, op0);
} }
break; break;
......
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