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: unassig...@gcc.gnu.org
        ReportedBy: bur...@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 via email to