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: On inlining in C++


> For most targets, the only difference between -O2 and -O3 is that, with
> the latter, we find more functions to inline, beyond those explicitly
> marked as inline.  I read Gaby's argument as describing the behavior of
> -O2, not of -O3 (for which we will still need heuristics to drive inlining
> decisions).

Well of course the term "explicitly marked" is a bit contentious in this 
thread :-)

The point I was making is that indeed excessive inlining can be harmful.

In C++ the practice of writing simple functions in the header is not just
a matter of the programmer "requesting inline explicitly", but also it
is just the more convenient way of doing things, and doing otherwise may
be undesirable for structural and documentation purposes.

So to think that a C++ programmer is always conciously expecting and 
requesting inline when the keyword is not explicitly used seems a bit of
a dubious claim to me.

Certainly the most convincing evidence would be specific examples of
real applications compiled and run both ways. This thread seems short on
such examples.


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