This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [c++] Remove iffy uses of DECL_INLINE
Jan Hubicka wrote:
I'm a little worried that because of the more generous definition of
possibly_inlined_p we'll synthesize more methods and such and thus slow
down the compiler. Have you looked at compile-time or memory impact on,
say, libstdc++ compilation?
I tested Gerald's testcase and saw no differences.
When I read the patch, I realized that some of the changes were probably
unlikely to make a big difference in practice; I'm glad you looked at
it. Go ahead with the patch.
But, please do be aware that the template call graphs can be massive.
For certain classes of C++ programs, our default of -fimplicit-templates
is definitely not what you want -- you can end up with tons (tens of
thousands, or even hundreds of thousands) of template functions being
instantiated in every file because you include headers full of templates
and then call one of them which sets off a giant chain recaction. You
really want to do these IPA optimizations on templates at link-time:
instantiate the functions once, then do inlining and other cleverness
across the entire application or library. So, we should watch out for
this problem, not just because of this patch, but in general.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713