From af7b5c1c00a3ee89369358ef8a53f4b4b74bbbf9 Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Tue, 12 Aug 2003 01:43:31 +0000 Subject: [PATCH] fold-const.c (fold): Optimize any associative floating point operator with... * fold-const.c (fold): Optimize any associative floating point operator with -funsafe-math-optimizations, not just MULT_EXPR. From-SVN: r70348 --- gcc/ChangeLog | 5 +++++ gcc/fold-const.c | 8 +++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 959f77debdda..39d3f203361d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-08-11 Roger Sayle + + * fold-const.c (fold): Optimize any associative floating point + operator with -funsafe-math-optimizations, not just MULT_EXPR. + 2003-08-11 Kaz Kojima * config/sh/lib1funcs.asm (__udivdi3): Add .type and .size diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 9333c5907477..9db9f2e5257f 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -5803,13 +5803,11 @@ fold (tree expr) associate: /* In most languages, can't associate operations on floats through parentheses. Rather than remember where the parentheses were, we - don't associate floats at all. It shouldn't matter much. However, - associating multiplications is only very slightly inaccurate, so do - that if -funsafe-math-optimizations is specified. */ + don't associate floats at all, unless the user has specified + -funsafe-math-optimizations. */ if (! wins - && (! FLOAT_TYPE_P (type) - || (flag_unsafe_math_optimizations && code == MULT_EXPR))) + && (! FLOAT_TYPE_P (type) || flag_unsafe_math_optimizations)) { tree var0, con0, lit0, minus_lit0; tree var1, con1, lit1, minus_lit1; -- 2.47.2