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

--- Comment #40 from Sven C. Dack <sven.c.dack at virginmedia dot com> ---
I ran benchmarks and got some unusual results. Or perhaps it is a regression?

I have created 4 versions of gcc and used these to timed the time it takes to
compile a linux kernel. The configuration of the 4 gcc's are:

CFLAGS='-pipe -O2 -march=native -fomit-frame-pointer -fno-builtin-memcmp'

default:
  configure ...
  make bootstrap

profiled:
  configure ...
  make profiledbootstrap

lto:
  configure ... --with-build-config=bootstrap-lto
  make bootstrap

lto-plugin:
  configure ... --with-build-config=bootstrap-lto
--with-boot-ldflags="-fuse-linker-plugin"
  make bootstrap

The results are the averages (and deviations) of 5 runs with each compiler:

                avg           stdev          %
default:    282.86s    0.56s, 0.20%    100.00% (base)
profiled:   255.76s    0.72s, 0.28%    +10.60%
lto:        282.80s    0.16s, 0.06%     +0.02%
lto-plugin: 285.41s    0.49s, 0.17%     -0.89%

The file sizes of the cc1's are:

default:    84920k
profiled:   90176k
lto:        71204k
lto-plugin: 60024k

So boot strapping with LTO does not make gcc faster, but only smaller and also
takes more time. It is almost as if I had used -Os (and not -O2).

With the linker plugin enabled does it actually link libgcc_s.so and
libstdc++.so dynamically to it, while for the other three it did not:

default cc1:
    libmpc.so.3 => /home/sven/gcc-default/lib/libmpc.so.3
    libmpfr.so.4 => /home/sven/gcc-default/lib/libmpfr.so.4
    libgmp.so.10 => /home/sven/gcc-default/lib/libgmp.so.10
profiled cc1:
    libmpc.so.3 => /home/sven/gcc-profiled/lib/libmpc.so.3
    libmpfr.so.4 => /home/sven/gcc-profiled/lib/libmpfr.so.4
    libgmp.so.10 => /home/sven/gcc-profiled/lib/libgmp.so.10
lto cc1:
    libmpc.so.3 => /home/sven/gcc-lto/lib/libmpc.so.3
    libmpfr.so.4 => /home/sven/gcc-lto/lib/libmpfr.so.4
    libgmp.so.10 => /home/sven/gcc-lto/lib/libgmp.so.10
lto-plugin cc1:
    libmpc.so.3 => /home/sven/gcc-lto-plugin/lib/libmpc.so.3
    libmpfr.so.4 => /home/sven/gcc-lto-plugin/lib/libmpfr.so.4
    libgmp.so.10 => /home/sven/gcc-lto-plugin/lib/libgmp.so.10
    libstdc++.so.6 => /home/sven/gcc-lto-plugin/lib64/libstdc++.so.6
    libgcc_s.so.1 => /home/sven/gcc-lto-plugin/lib64/libgcc_s.so.1

I will try doing the same but with statically linked compilers.

Reply via email to