-finline-functions does not affect libstdc++?

Chris Lattner sabre@nondot.org
Mon Oct 27 19:31:00 GMT 2003


Richard Guenther wrote:
> It seems specifying -finline-functions with gcc3.4 does not affect
> libstdc++ declarations!? I figured this out while doing work on
> attribute((leafify)). Is this intentional? At least it hurts performance
> quite a bit!

This is because almost all of libstdc++ is specified in terms of
"external" templates.  For example, ostream and istream all use external
templates, so the compiler does not instantiate them except when building
libstdc++.  Presumably this is a performance optimization of the compiler
itself, rather than of the code.

Link-time inlining/optimization obviously fixes this problem.  :)

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/



More information about the Gcc mailing list