This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: -finline-functions does not affect libstdc++?
- From: Chris Lattner <sabre at nondot dot org>
- To: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 27 Oct 2003 12:38:31 -0600 (CST)
- Subject: RE: -finline-functions does not affect libstdc++?
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/