[LTO] Question about comdat linkage of implicit ctor and dtor.

Doug Kwan (關振德) dougkwan@google.com
Sat Nov 22 00:42:00 GMT 2008


Hi,

2008/11/21 Mark Mitchell <mark@codesourcery.com>:

> I don't think that's true.  The linkage of the constructor or destructor
> cannot be determined until the linkage of the class as a whole is
> determined, and we might not know that until later in the file.
> However, it certainly can be determined at the end of the translation
> unit.  And, if we're generating implicit constructors in implicitly
> instantiated template classes, without marking them as having vague
> linkage, that certainly sounds like a bug.  However, I'd think it would
> also show up without LTO when not optimizing, as that would result in
> multiple definitions at link-time.

The destructors in question were not emitted but reachable via BINFOs.
 Before Rafael checked in his BINFO removal patch, the virtual
desctructors were still visible in LTO output file.  After Rafael's
patch, we still see this problem and I am look at that.

Since we can determine vague linkage at the end-of-file, I guess it is
okay to make decision for all functions DECLs in free_lang_specific,
when we have read the whole file and right before we forget all FE
specific information.

-Doug



More information about the Gcc-patches mailing list