From 5a3d4befaf03c1f5cc09f841520f26865c98d387 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Wed, 31 Mar 1993 15:57:24 -0500 Subject: [PATCH] (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 --- gcc/cse.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gcc/cse.c b/gcc/cse.c index a2aac9447fc..44c75e60cf5 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -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; -- 2.30.2