empty function optimizations

Jan Reimers janr@molienergy.bc.ca
Wed Jul 12 12:50:00 GMT 2000


> -----Original Message-----
> From: Martin v. Loewis [ mailto:martin@loewis.home.cs.tu-berlin.de ]
> Sent: Wednesday, July 12, 2000 12:03 PM
> To: jbuck@racerx.synopsys.com
> Cc: ken@gesn.com; gcc@gcc.gnu.org
> Subject: Re: empty function optimizations
> 
> 
> > I agree with you that this is a problem, but believe that 
> the appropriate
> > fix isn't in the linker, but is to improve STL instead to 
> use partial
> > specialization.  The results would be better than you would 
> be able to
> > get by trying to use the linker to remove duplicate code.
> 
> I personally believe that the right fix is in the compiler, which
> should statically determine that instantiations don't depend on the
> some template parameters, and mangle the function names with a
> wildcard. 
Rather, the function should only depend on sizeof(T), which would then be
mangled into the name.

> The tricky part, of course, is to define the exact mechanism for
> determining independence from template parameters.
..determining independence from aspects of the template parameter ***other
than sizeof(T)***.

This technology would go a long way towards countering one of the major
complaints people have with C++, namely code bloat.

JR
> 
> Regards,
> Martin
> 


More information about the Gcc mailing list