This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: use C++ semantics for inline functions (defined in headers)
- From: Gabriel Dos Reis <gdr at axiomatics dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 31 Mar 2013 09:41:34 -0500
- Subject: Re: C++ PATCH: use C++ semantics for inline functions (defined in headers)
- References: <87a9pnbpq5 dot fsf at euclid dot axiomatics dot org> <alpine dot DEB dot 2 dot 02 dot 1303311155220 dot 3902 at laptop-mg dot saclay dot inria dot fr>
Marc Glisse <marc.glisse@inria.fr> writes:
| 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.
|
| Hi,
|
| the size reduction looks nice, should the same be applied throughout the
| compiler?
Yes, ideally this should be done throught the entire compiler, except
for the headers/functions that are still shared with the runtime
compiled with a C compiler.
| I didn't check if the cxx-conversion branch already does it.
No, it does not do it -- at least when I checked.
-- Gaby