This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH: use C++ semantics for inline functions (defined in headers)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]