This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix -fwhole-program on LTO -- Another SPEC2000 benchmakring round


On Mon, 12 Oct 2009, Steven Bosscher wrote:

> On Mon, Oct 12, 2009 at 10:07 PM, Richard Guenther <rguenther@suse.de> wrote:
> > On Mon, 12 Oct 2009, Andi Kleen wrote:
> >
> >> Diego Novillo <dnovillo@google.com> writes:
> >> >
> >> > Yes, we compile everything twice since .o files have both final object
> >> > code and gimple bytecode.
> >>
> >> Would it be possible to add a flag to turn the final object code
> >> generation off?
> >
> > Patches welcome ;)
> 
> But IIUC, you can compile with "-O0 -flto" and then link with "-O[123]
> -flto", right?  So that should already have almost the same desired
> result (faster compile times) as turning off code generation
> completely.

It's possible but I would not recommend it (especially because the
different gimple lowering paths we take for -O0 vs. -Ox).  You also
loose early optimizations which will likely increase the amount
of memory needed during link-time optimization.  At the moment
you'll also force alias-sets to be zero for link-time optimization
(because -O0 disables strict-aliasing and we carry over if a type
has alias-set zero).

> If the above is true, is it then also possible to the following:
> 1. compile with "-O0 -flto -g3"
> 2. link with "-O0 -g3" to have a binary with all debug info to do debugging
> 3. link with "-O[123] -flto" to have an optimized binary
> ?

In theory yes.  In practice we'll drop to -g0 when you specify -flto
because debuginfo is not yet implemented.

> That would be really useful for people like me who can never get their
> Fortran programs "right-first-time" :-)

I guess the advise to them is to not use -flto during development.

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]