Bug 21587 - Explicit inlining should never fail
Summary: Explicit inlining should never fail
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.0
: P2 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2005-05-15 16:46 UTC by Mike Sharov
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Mike Sharov 2005-05-15 16:46:20 UTC
When compiling with -Winline -O[2,3,s], I frequently get errors like:

mistream.h:196: warning: called from here
mistream.h:174: warning: inlining failed in call to 'bool
ustl::istream::aligned(size_t) const': --param large-function-growth limit reached

This is understandable, since I use a lot of inlining and inevitably run over
this limit or one of the others. Explicitly increasing the --param value solves
the problem.

However, it bothers me that the compiler requires special flags to inline
functions that I have already explicitly declared as inline. When I use the
inline keyword in a declaration, I expect the compiler to inline it no matter
what, with debug builds being the only exception.

So can the optimizer automatically adjust inlining parameters and inline
everything I tell it to inline? I suppose it might be a bit of work, since
explicit parameter limits should still be honored.
Comment 1 Andrew Pinski 2005-05-15 17:33:07 UTC
inline is always been just a hint to the compiler, sorry, this is how the standard is worded (or very 

For 4.1.0, we should have optimization before inlining and should be better at estimating the size of 
the function.  The params are there so we can tune GCC, if you instead supply a testcase to a new bug 
where we don't inline fully, that would be better than changing how this works.