This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][RFC] Enable -flto during bootstrap
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 19 Aug 2009 18:09:38 +0200 (CEST)
- Subject: Re: [PATCH][RFC] Enable -flto during bootstrap
- References: <alpine.LNX.2.00.0908191431160.16347@zhemvz.fhfr.qr>
On Wed, 19 Aug 2009, Richard Guenther wrote:
>
> This patch automatically enables -flto for all host binaries and libraries
> via BOOT_CFLAGS and BOOT_LDFLAGS when lto is enabled. It also adds
> lto to the set of stage1 languages.
>
> Before applying this patch we should fix PR41079, the linker aggregating
> all lto sections from static libraries into the final executable.
>
> I will followup with a bootstrap time comparison.
On a slightly loaded system I configured with
--enable-lto --enable-languages=c,lto --enable-stage1-languages=c,lto
and built the stage1. Then the bootstrap time for finishing the
bootstrap (thus builting stage2 and stage3 and the target libs)
on an x86_64 system (with multilibs enabled) is
make -j2 BOOT_CFLAGS="-O2 -g -flto" BOOT_LDFLAGS="-Wl,-T/tmp/ltoscript
-flto"
6461.40user 366.25system 1:05:38elapsed 173%CPU (0avgtext+0avgdata
0maxresident)k
20976inputs+4765256outputs (19major+69723922minor)pagefaults 0swaps
vs.
make -j2
5416.07user 310.33system 53:15.59elapsed 179%CPU (0avgtext+0avgdata
0maxresident)k
624inputs+3758600outputs (0major+59758977minor)pagefaults 0swaps
the ltoscript linker script strips the lto sections from the final
executables (otherwise they are currently 100MB vs 10MB and likely
that would affect the boostrap time).
that's a 16% overhead during stage2 and stage3 where the difference
is most prominent - you have to add the overhead of bootstrapping lto1
itself. Not too bad IMHO and acceptable on the branch for the extra
lto testing coverage.
Richard.