public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/46900] New: 50% slowdown when linking with LTO in a single step
Date: Sun, 12 Dec 2010 10:31:00 -0000	[thread overview]
Message-ID: <bug-46900-4@http.gcc.gnu.org/bugzilla/> (raw)

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

           Summary: 50% slowdown when linking with LTO in a single step
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


Cf. PR 44334 for another LTO slowdown. Cf.
http://gcc.gnu.org/ml/fortran/2010-12/msg00067.html


I had expected that doing the LTO linkage in one or in two steps is identical,
but seemingly it is not:

$ gfortran -fexternal-blas -flto -Ofast -march=native \
           test.f90 dgemm.f lsame.f xerbla.f
$ ./a.out 
 Time, MATMUL:    1.4680910       53.480084765505403     
 dgemm:    1.4720919       56.452265589399069


But if one first compiles and then links (w/ or w/o LTO), the programm is 47%
faster:

$ gfortran -fexternal-blas -Ofast -march=native \
           test.f90 dgemm.f lsame.f xerbla.f
 Time, MATMUL:    1.0080630       53.480084765505403     
 dgemm:    1.0200630       56.452265589399069     

$ gfortran -c -fexternal-blas -flto -Ofast -march=native \
              test.f90 dgemm.f lsame.f xerbla.f 
$ gfortran -flto -Ofast -march=native test.o dgemm.o lsame.o xerbla.o
$ ./a.out 
 Time, MATMUL:    1.0080630       53.480084765505403     
 dgemm:    1.0080630       56.452265589399069


(If one


             reply	other threads:[~2010-12-12 10:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-12 10:31 burnus at gcc dot gnu.org [this message]
2010-12-12 10:33 ` [Bug middle-end/46900] " burnus at gcc dot gnu.org
2010-12-12 10:34 ` burnus at gcc dot gnu.org
2010-12-12 10:39 ` [Bug middle-end/46900] [4.6 Regression] " burnus at gcc dot gnu.org
2010-12-12 10:50 ` burnus at gcc dot gnu.org
2010-12-16 14:40 ` rguenth at gcc dot gnu.org
2010-12-16 15:24 ` burnus at gcc dot gnu.org
2010-12-17 12:14 ` d.g.gorbachev at gmail dot com
2011-01-19 17:10 ` rguenth at gcc dot gnu.org
2011-01-19 22:11 ` burnus at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-46900-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).