]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
fold-const.c (fold): Optimize any associative floating point operator with...
authorRoger Sayle <roger@eyesopen.com>
Tue, 12 Aug 2003 01:43:31 +0000 (01:43 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Tue, 12 Aug 2003 01:43:31 +0000 (01:43 +0000)
* fold-const.c (fold): Optimize any associative floating point
operator with -funsafe-math-optimizations, not just MULT_EXPR.

From-SVN: r70348

gcc/ChangeLog
gcc/fold-const.c

index 959f77debdda34f0c193494bb1743a229aabcb91..39d3f203361de543c8e07139b9fb1f6db2f19b7d 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-11  Roger Sayle  <roger@eyesopen.com>
+
+       * fold-const.c (fold): Optimize any associative floating point
+       operator with -funsafe-math-optimizations, not just MULT_EXPR.
+
 2003-08-11  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        * config/sh/lib1funcs.asm (__udivdi3): Add .type and .size
index 9333c5907477766856e1b33eaafd600e3734c25c..9db9f2e5257f7126caab96447f72de409584644e 100644 (file)
@@ -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;