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

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).