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

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> ---
So, yeah.

When we were originally developing the ABI, we wanted to allow implementations
to make all of the symbols entry points to the same function.  But this didn't
end up being reflected in the ABI document, which doesn't currently allow for
sharing a COMDAT group at all:

"Implicitly-defined or inline user-defined constructors and destructors are
emitted where referenced, each in its own COMDAT group identified by the
constructor or destructor name."

I started a discussion about this on the ABI list in 2009 but it didn't
conclude.  It sounds like most other compilers still put the destructors in
different groups.  clang avoids creating two identical clones by just omitting
the complete-object clone (and putting the base clone in the vtable), which
also seems nonconformant.  Apparently HP puts all the constructors in a C3
group but uses separate groups for the destructors.

So we're already incompatible with everyone else on this, though it's pretty
harmless because the worst that can happen is a bit of extra bloat.  So we
don't need to consider compatibility with other vendors in this decision and
can just do what's right for us.

I think I'm sympathetic to Rafael's argument that we should stick with the 4.7
behavior since that's what most deployed GCCs currently do.

Reply via email to