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]

Re: GCC -On optimization passes: flag and doc issues


"Dave Korn" <dave.korn@artimi.com> writes:

>   Sorry for butting in, but I just can't follow the reasoning here.  Unless a
> function is only ever used once and is inlined at the single callsite, or
> unless the prolog and epilog are several times the size of the function body,
> isn't inlining /always/ (not just "typically", but actually *always*) going to
> increase code size?  I feel I must be missing something really obvious... is
> it just that the other optimisations that become possible on inline code
> usually compensate?

It's pretty much always going to be a win to inline
    int f (int a) { return g (a); }
And while that kind of thing looks silly in isolation, it is quite
common in class methods in C++.

Ian


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