"Steven Bosscher" <[EMAIL PROTECTED]> writes: > Isn't this what you describe here the same as COMDAT?
Not exactly. COMDAT means that the compiler can generate multiple instances of, say, the list<int> functions, and only one version will be included in the final executable. However, if you use both list<int> and list<long>, they will both wind up in the executable. The proposal here is that in the case where list<int> and list<long> generate identical code, only one version winds up in the executable, with two symbols associated with it. I think Danny has a 75% implementation based on hashing the RTL for a section and using that to select the COMDAT section signature. Or the hashing can be done in the linker, but it still needs compiler help to know when it is permissible. Ian > On 9/15/06, Michael Popov <[EMAIL PROTECTED]> wrote: > > Hello! > > > > There is very good blog post about the problem: > > http://vladimir_prus.blogspot.com/2005/03/duplicate-function-bodies.html > > > A couple of days ago I've learned that the Microsoft linker can merge > > > functions with binary identical bodies. Looks rather good idea, > > > especially with templates, and it seems that gcc does not implement this. > > > > Will GCC support this feature? > > It might be very useful in some cases, reduce code size and locality. > > > > > > Some info about possible problems can be found here: > > http://blogs.msdn.com/oldnewthing/archive/2005/03/22/400373.aspx > > > > So, due to incompatibilities with debugging and C/C++ standards > > this feature should be optional and disabled by default. > > > > > > Best regards, > > Michael > >