This is the mail archive of the gcc@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]

when does Optimization happen....


I understand that gcc -On happens before generating assembly code (.s), is it correct?
#gcc -S main.c; gcc -o a.out main.s (here without optimization)
#gcc -O2 -S main.c; gcc -o a1.out main.s (here with optimization of O2)


But some optimization, such as inlining, may require cross compilation-unit (i.e, cross file) information. It seems that these kind of optization is better to be handled at link time (thus, cross compilation units info is available).

Can someone give an explanation how gcc hanle this internally? Many thanks

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



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