On Mon, Nov 1, 2010 at 19:57, Hongtao <yu...@purdue.edu> wrote: > Hi All, > > While using gcc-4.6 with option -flto, I found that interprocedural > analysis were performed on each source file separately. For example for > the pass pass_ipa_pta, if we compile two files like : > gcc -O -flto f1.c f2.c > we have the pass run twice, one for each source file. So is there a way > that can perform IPA on all source files together?
With -combine you used to be able to do this, but it has been removed in favour of -flto (actually, I'm not quite sure whether it's been removed already, but it's on the chopping block). With -flto, IPA will be performed on all the files together, as well as each file separately. In your example, IPA runs 3 times. Once for each f1.c and f2.c, and a third time with both f1.o and f2.o as a single translation unit. Diego.