diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1993-03-31 15:57:24 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1993-03-31 15:57:24 -0500 |
commit | 5a3d4befaf03c1f5cc09f841520f26865c98d387 (patch) | |
tree | 67584a19d59eca2c45bde16d8017123c6f2c6d29 | |
parent | 0b6b29004875046757143caa8a0552d236d137f0 (diff) | |
download | gcc-5a3d4befaf03c1f5cc09f841520f26865c98d387.zip gcc-5a3d4befaf03c1f5cc09f841520f26865c98d387.tar.gz gcc-5a3d4befaf03c1f5cc09f841520f26865c98d387.tar.bz2 |
(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
-rw-r--r-- | gcc/cse.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -3565,15 +3565,23 @@ simplify_binary_operation (code, mode, op0, op1) && GET_MODE_CLASS (GET_MODE (op1)) == MODE_FLOAT) { 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); + 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 */ - if (REAL_VALUES_EQUAL (d, dconst2) - && GET_MODE (op0) == mode) + if (op1is2 && GET_MODE (op0) == mode) return gen_rtx (PLUS, mode, op0, copy_rtx (op0)); - else if (REAL_VALUES_EQUAL (d, dconstm1) - && GET_MODE (op0) == mode) + else if (op1ism1 && GET_MODE (op0) == mode) return gen_rtx (NEG, mode, op0); } break; |