public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98429] New: Some FMA expressions are evaluated less efficiently when -ffast-math is active
@ 2020-12-23 17:22 chtz at informatik dot uni-bremen.de
  2021-01-05  9:45 ` [Bug middle-end/98429] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: chtz at informatik dot uni-bremen.de @ 2020-12-23 17:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98429
           Summary: Some FMA expressions are evaluated less efficiently
                    when -ffast-math is active
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chtz at informatik dot uni-bremen.de
  Target Milestone: ---

If you compile an expression like

    x - x*y

using fast-math optimizations it appears to get re-arranged to 

   x*(1-y)

which is (probably) never more efficient than the original expression,
especially if the target supports FMA operations.

Simple godbolt demonstration: https://godbolt.org/z/4q1oj9

(This is very likely not C++ specific, but I'm not sure what the correct
component is -- I also just tried this for AVX-FMA)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug middle-end/98429] Some FMA expressions are evaluated less efficiently when -ffast-math is active
  2020-12-23 17:22 [Bug c++/98429] New: Some FMA expressions are evaluated less efficiently when -ffast-math is active chtz at informatik dot uni-bremen.de
@ 2021-01-05  9:45 ` rguenth at gcc dot gnu.org
  2021-09-06 18:35 ` pinskia at gcc dot gnu.org
  2021-09-06 18:37 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-05  9:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-01-05
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
          Component|tree-optimization           |middle-end

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
This probably asks for a special case during RTL expansion or FMA forming
phase.
In itself this is first canonicalization (the user could have written
x*(1-y) which should also expand to FMA I suppose).

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug middle-end/98429] Some FMA expressions are evaluated less efficiently when -ffast-math is active
  2020-12-23 17:22 [Bug c++/98429] New: Some FMA expressions are evaluated less efficiently when -ffast-math is active chtz at informatik dot uni-bremen.de
  2021-01-05  9:45 ` [Bug middle-end/98429] " rguenth at gcc dot gnu.org
@ 2021-09-06 18:35 ` pinskia at gcc dot gnu.org
  2021-09-06 18:37 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-06 18:35 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mkretz at gcc dot gnu.org

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 102219 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug middle-end/98429] Some FMA expressions are evaluated less efficiently when -ffast-math is active
  2020-12-23 17:22 [Bug c++/98429] New: Some FMA expressions are evaluated less efficiently when -ffast-math is active chtz at informatik dot uni-bremen.de
  2021-01-05  9:45 ` [Bug middle-end/98429] " rguenth at gcc dot gnu.org
  2021-09-06 18:35 ` pinskia at gcc dot gnu.org
@ 2021-09-06 18:37 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-06 18:37 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 56547.

*** This bug has been marked as a duplicate of bug 56547 ***

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-06 18:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-23 17:22 [Bug c++/98429] New: Some FMA expressions are evaluated less efficiently when -ffast-math is active chtz at informatik dot uni-bremen.de
2021-01-05  9:45 ` [Bug middle-end/98429] " rguenth at gcc dot gnu.org
2021-09-06 18:35 ` pinskia at gcc dot gnu.org
2021-09-06 18:37 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).