https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61139

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-05-13
     Ever confirmed|0                           |1
           Severity|normal                      |enhancement

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
The issue is that reassoc doesn't fold stmts but we end up with

   <bb 2>:
   _3 = *x_2(D);
-  _5 = w_4(D) - _3;
-  _6 = _5 + w_4(D);
+  _8 = -_3;
+  _9 = w_4(D) + w_4(D);
+  _6 = _9 - _3;

instead of

   _9 = w_4(D) * 2.;

of course FMA recognition could also be enhanced to handle this case
(of course all the issue re-appears for w + w + w then, which should
be w * 3.).  So probably reassocs job in the end anyway.

Confirmed.

Reply via email to