From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5117 invoked by alias); 3 Sep 2014 20:45:25 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 5069 invoked by uid 48); 3 Sep 2014 20:45:19 -0000 From: "jason at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/62306] [4.9/5 Regression?] Change in the comdat used for constructors Date: Wed, 03 Sep 2014 20:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jason at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-09/txt/msg00998.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62306 --- Comment #8 from Jason Merrill --- 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.