This is the mail archive of the
mailing list for the GCC project.
[Bug c++/24947] New: -Os should maximize inlining --param values.
- From: "msharov at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Nov 2005 00:58:33 -0000
- Subject: [Bug c++/24947] New: -Os should maximize inlining --param values.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When compiling with -Os and -Winline, many warnings like this occur:
file.cc:25: warning: inlining failed in call to 'function': --param
inline-unit-growth limit reached
because the optimizer's inlining code gives up too early. The parameters most
commonly exceeded are max-inline-insns-single, inline-unit-growth, and
large-function-growth. This happens pretty much all the time in my code from
all those deep STL interfaces, and I constantly have to specify some more
appropriate (higher) values for the offending parameters.
All C++ code I have ever seen is written with lots of inlines. Those inline
functions, almost always reduce code size when inlined, and when the optimizer
passes them by, it leaves behind function calls to simple accessors that could
have been compiled as a single movl.
Since -Os is supposed to optimize for size, it would be most logical to set
those --param values to their maximum values (I use 1024, which works so far)
to ensure all the inline functions are inlined. This works for -Os because
-finline-functions is disabled and only those functions that are explicitly
declared inline are inlined. With -finline-functions the large inlining
parameters would probably generate nothing but bloat, and should remain at
Summary: -Os should maximize inlining --param values.
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: msharov at hotmail dot com
GCC build triplet: athlon-gnu-linux
GCC host triplet: athlon-gnu-linux
GCC target triplet: athlon-gnu-linux