public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/65376] New: LTO prevents use of fmadd
@ 2015-03-10  8:47 pinskia at gcc dot gnu.org
  2015-03-10  9:21 ` [Bug lto/65376] " mkuvyrkov at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-03-10  8:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65376
           Summary: LTO prevents use of fmadd
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
            Target: aarch64*

Take:
int main(void)
{
  return 0;
}

double f(double a, double b, double c) __attribute__((used));
double f(double a, double b, double c)
{
  return b*b+a*a;
}

--- CUT ---
Compile with -flto  -Ofast t5.c -o t6.
And then dump the resulting executable, we get:
0000000000400530 <f>:
  400530:       1e610821        fmul    d1, d1, d1
  400534:       1e600800        fmul    d0, d0, d0
  400538:       1e602820        fadd    d0, d1, d0
  40053c:       d65f03c0        ret


Without -flto we get:
0000000000400530 <f>:
  400530:       1e600800        fmul    d0, d0, d0
  400534:       1f410020        fmadd   d0, d1, d1, d0
  400538:       d65f03c0        ret


AARCH64 is just an example, it is most likely a bug everywhere.
Using -ffp-contract=fast on the command line is a workaround.

I don't know if this is a regression either.


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

* [Bug lto/65376] LTO prevents use of fmadd
  2015-03-10  8:47 [Bug lto/65376] New: LTO prevents use of fmadd pinskia at gcc dot gnu.org
@ 2015-03-10  9:21 ` mkuvyrkov at gcc dot gnu.org
  2015-03-10  9:31 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mkuvyrkov at gcc dot gnu.org @ 2015-03-10  9:21 UTC (permalink / raw)
  To: gcc-bugs

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

Maxim Kuvyrkov <mkuvyrkov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mkuvyrkov at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |prathamesh3492 at gcc dot gnu.org

--- Comment #1 from Maxim Kuvyrkov <mkuvyrkov at gcc dot gnu.org> ---
Prathamesh,

Would you please look at this?


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

* [Bug lto/65376] LTO prevents use of fmadd
  2015-03-10  8:47 [Bug lto/65376] New: LTO prevents use of fmadd pinskia at gcc dot gnu.org
  2015-03-10  9:21 ` [Bug lto/65376] " mkuvyrkov at gcc dot gnu.org
@ 2015-03-10  9:31 ` rguenth at gcc dot gnu.org
  2015-03-12 15:42 ` ramana at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-10  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |lto
             Target|aarch64*                    |
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-03-10
     Ever confirmed|0                           |1
      Known to fail|                            |4.8.3, 4.9.2, 5.0

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed on x86_64 with -mfma.  Doesn't work with 4.8 or 4.9 either.


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

* [Bug lto/65376] LTO prevents use of fmadd
  2015-03-10  8:47 [Bug lto/65376] New: LTO prevents use of fmadd pinskia at gcc dot gnu.org
  2015-03-10  9:21 ` [Bug lto/65376] " mkuvyrkov at gcc dot gnu.org
  2015-03-10  9:31 ` rguenth at gcc dot gnu.org
@ 2015-03-12 15:42 ` ramana at gcc dot gnu.org
  2015-03-12 15:43 ` ramana at gcc dot gnu.org
  2015-03-12 20:58 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ramana at gcc dot gnu.org @ 2015-03-12 15:42 UTC (permalink / raw)
  To: gcc-bugs

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

Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ramana at gcc dot gnu.org
   Target Milestone|---                         |5.0

--- Comment #4 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
I think this is not an issue any longer on 5.0. With a cross-compiler to
aarch64-none-linux-gnu built on 09032015, I see the following output

$GCC -flto -Ofast /tmp/fma.c -o t

0000000000400528 <f>:
  400528:       1e600800        fmul    d0, d0, d0
  40052c:       1f410020        fmadd   d0, d1, d1, d0
  400530:       d65f03c0        ret
  400534:       d503201f        nop


Didn't honza do some work earlier this year in the 5.0 time frame to treat
ffp-contract similar to other options for LTO ? 

regards
Ramana


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

* [Bug lto/65376] LTO prevents use of fmadd
  2015-03-10  8:47 [Bug lto/65376] New: LTO prevents use of fmadd pinskia at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-03-12 15:42 ` ramana at gcc dot gnu.org
@ 2015-03-12 15:43 ` ramana at gcc dot gnu.org
  2015-03-12 20:58 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ramana at gcc dot gnu.org @ 2015-03-12 15:43 UTC (permalink / raw)
  To: gcc-bugs

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

Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:

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

--- Comment #5 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
Fixed.


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

* [Bug lto/65376] LTO prevents use of fmadd
  2015-03-10  8:47 [Bug lto/65376] New: LTO prevents use of fmadd pinskia at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-03-12 15:43 ` ramana at gcc dot gnu.org
@ 2015-03-12 20:58 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-03-12 20:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Works for me, I don;t know what I was doing incorrect.


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

end of thread, other threads:[~2015-03-12 20:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-10  8:47 [Bug lto/65376] New: LTO prevents use of fmadd pinskia at gcc dot gnu.org
2015-03-10  9:21 ` [Bug lto/65376] " mkuvyrkov at gcc dot gnu.org
2015-03-10  9:31 ` rguenth at gcc dot gnu.org
2015-03-12 15:42 ` ramana at gcc dot gnu.org
2015-03-12 15:43 ` ramana at gcc dot gnu.org
2015-03-12 20:58 ` 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).