This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/46900] New: 50% slowdown when linking with LTO in a single step
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 12 Dec 2010 10:30:58 +0000
- Subject: [Bug fortran/46900] New: 50% slowdown when linking with LTO in a single step
- Auto-submitted: auto-generated
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