This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Hi Mark,

    I ran into to a bug where ILs in different files contain identical
DECLs of an implicit virtual destructor of an instantiated template
class.  That happened in the BINFOs.  Rafael just removed the BINFOs
in the IL but the underlying problem is the there.  The problem was
caused by lack of vague linkage indication in the DECLs so LTO
complained about multiple definition.  Actually the destructor was not
defined in either of the object files.  It was not emitted.  So gcc
did to called import_export_decl to determine the linkage.  As far as
I know it is an error to re-define an implicitly declared
constructor/destructor.  So gcc should be able to determine the
linkage early, when such a constructor/destructor is declared
implictly.  I tried to look at the logic of import_export_decl and it
is not simple because of additional interactions of the -frepo and
-fweak.  Do you know if it is safe to have import_export_decl to
compute the right linkage setting early for implicit constructors and
destructors? Thanks.

-Doug


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]