GCC IMA & general future proposal

Matt Austern austern@apple.com
Wed Oct 27 18:57:00 GMT 2004

On Oct 27, 2004, at 10:50 AM, Daniel Berlin wrote:

>> This may be a stupid suggestion and is probably not as general
>> as what EDG is doing but couldn't the template instantiations be
>> put into special sections and then let ld eliminate the duplicates
>> as it merges the object files into the executable?
> This is what we do now.
> However, it doesn't save the work of doing the instantiation, only the 
> space it costs in the final executable.
> They seem to be talking about saving the work of doing duplicate 
> instantiation in the first place.

We have to be careful, though.  The Sun model, where you try to 
instantiate a template only once, is more fragile than our model, it 
can sometimes result in even longer compile times (my first impression, 
when I moved from the EDG-based SGI compiler to gcc, was how much 
faster gcc was), and it introduces dependencies that aren't reflected 
in the makefile.  The Sun model has some advantages, but it is 
definitely not a uniform win.

We also have to be careful about accumulating more and more template 
instantiation models without ever throwing any away.  We've now got the 
instantiate-everything-and-merge model, the 
explicit-instantiations-only model, and the repository model.  Let's 
try not to go from three models to four.

Now what I *could* get behind, if we want to think about radical 
changes to our template instantiation model, is either implementing 
export or implementing something that does a better job of solving the 
problems that export was designed to solve.


More information about the Gcc mailing list