------- Comment #3 from dnovillo at google dot com 2009-02-17 17:55 ------- Subject: Re: LTO and -fwhole-program do not play along well
On Tue, Feb 17, 2009 at 12:43, hubicka at ucw dot cz <gcc-bugzi...@gcc.gnu.org> wrote: > > > ------- Comment #2 from hubicka at ucw dot cz 2009-02-17 17:43 ------- > Subject: Re: LTO and -fwhole-program do not play along well > > Hi, > functions are brought local in function_and_variable_visibility that > needs to be scheduled after LTO is read in. > The pas computes externaly_visible flags that should be up-to-date for > early IPA passes before LTO is written out, so I guess we need early > function_and_vairable_visibility pass and late one where the first one > is not bringing functions local at -fwhole-program -lto OK, but I think there is a bigger issue here. Even if -flto is *not* used, we get link errors. Just by compiling each file with -fwhole-program is enough to reproduce the failure: $ gcc -fwhole-program -c f1.c $ gcc -fwhole-program -c f2.c $ gcc -fwhole-program -o f f1.o f2.o This is just a natural side-effect of using -fwhole-program. It was not intended to be used like this. Diego. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39203