public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/24947]  New: -Os should maximize inlining --param values.
@ 2005-11-20  0:58 msharov at hotmail dot com
  2005-11-20  1:31 ` [Bug c++/24947] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: msharov at hotmail dot com @ 2005-11-20  0:58 UTC (permalink / raw)
  To: gcc-bugs

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
present values.


-- 
           Summary: -Os should maximize inlining --param values.
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        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


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24947


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2006-08-21 12:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-20  0:58 [Bug c++/24947] New: -Os should maximize inlining --param values msharov at hotmail dot com
2005-11-20  1:31 ` [Bug c++/24947] " pinskia at gcc dot gnu dot org
2005-11-21  1:36 ` [Bug middle-end/24947] " pinskia at gcc dot gnu dot org
2005-11-21 15:07 ` msharov at hotmail dot com
2005-11-21 15:19 ` rearnsha at gcc dot gnu dot org
2005-11-21 15:35 ` msharov at hotmail dot com
2005-11-21 15:49 ` rearnsha at gcc dot gnu dot org
2005-11-21 16:01 ` msharov at hotmail dot com
2005-11-21 16:07 ` pinskia at gcc dot gnu dot org
2005-11-21 16:25 ` msharov at hotmail dot com
2006-08-21  5:35 ` pinskia at gcc dot gnu dot org
2006-08-21 12:45 ` hubicka at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).