This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/19988] [4.3/4.4/4.5 Regression] pessimizes fp multiply-add/subtract combo



------- Comment #23 from rguenth at gcc dot gnu dot org  2010-01-18 15:16 -------
And a fix along comment #14 would be (untested, but of course fixes the
testcase):

Index: gcc/fold-const.c
===================================================================
--- gcc/fold-const.c    (revision 156009)
+++ gcc/fold-const.c    (working copy)
@@ -1129,10 +1129,14 @@ negate_expr_p (tree t)
              && TYPE_OVERFLOW_WRAPS (type));

     case FIXED_CST:
-    case REAL_CST:
     case NEGATE_EXPR:
       return true;

+    case REAL_CST:
+      /* We want to canonicalize to positive real constants.  Pretend
+         that only negative ones can be easily negated.  */
+      return REAL_VALUE_NEGATIVE (TREE_REAL_CST (t));
+
     case COMPLEX_CST:
       return negate_expr_p (TREE_REALPART (t))
             && negate_expr_p (TREE_IMAGPART (t));


looks appealing, but let's check for fallout.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19988


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]