This is the mail archive of the
mailing list for the GCC project.
Re: C++ PATCH: use C++ semantics for inline functions (defined in headers)
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Gabriel Dos Reis <gdr at axiomatics dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 31 Mar 2013 12:01:46 +0200 (CEST)
- Subject: Re: C++ PATCH: use C++ semantics for inline functions (defined in headers)
- References: <87a9pnbpq5 dot fsf at euclid dot axiomatics dot org>
- Reply-to: gcc-patches at gcc dot gnu dot org
On Thu, 28 Mar 2013, Gabriel Dos Reis wrote:
C++ has a much more predictable semantics for inline functions, so we no
longer need to define them (especially in header files) with the
'static' specifier. The upshot is that when the compiler fails to
inline a call in a given translation unit, it keeps only one copy in the
entire program, instead of multiple copies (as the 'static' specifier
would have implied.)
With this patch, there is 2K reduction in size for cc1plus.
Applying to trunk. Tested on an x86_64-suse-linux.
the size reduction looks nice, should the same be applied throughout the
compiler? I didn't check if the cxx-conversion branch already does it.