[Bug c++/103490] Linkage type of typeinfo of polymorphic object with OOL functions

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Dec 22 07:07:47 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103490

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to John McCall from comment #3)
> I'm not sure I agree that that's the letter of the law, but even taken that
> as given, I think I would argue that it's a defect rather than something
> that has to be followed.  The purpose of the key-function optimization is to
> avoid the overheads of having to redundantly emit and unique v-tables.  A
> lot of uniquing can happen at link time, of course, but not all, and
> optimizing load times is important.

https://itanium-cxx-abi.github.io/cxx-abi/cxx-closed.html#B5

There was an open issue a long time ago which resolved this. If you think there
should be a new defect opened against the ABI be my guest but the resolution of
the original issue was resolved to say comdat in all cases.

"Resolution: Vtables will be emitted with the key function (first virtual
function that is not inline at the point of class definition), if any. If no
key function, emit everywhere used (i.e. referred to by name). Place in a
comdat group in all cases."

Given clang is the only compiler out there that is not complaint I think clang
should change.


More information about the Gcc-bugs mailing list