From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4302 invoked by alias); 19 Oct 2012 10:06:20 -0000 Received: (qmail 4200 invoked by uid 48); 19 Oct 2012 10:06:01 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/3187] gcc lays down two copies of constructors Date: Fri, 19 Oct 2012 10:06: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-Keywords: ABI, missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: jakub 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-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-10/txt/msg01738.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3187 --- Comment #41 from Jakub Jelinek 2012-10-19 10:05:55 UTC --- The reason why this hasn't been closed is that we only use an alias of one kind of ctor (resp. dtor) to the other one if they are the same (and for deleting dtor just always call the other dtor). If they are different, then they can't be aliased together, what we could do (perhaps as an option) is to emit another function, which would take an argument what kind of ctor resp. dtor it is, and behave differently depending on that argument, then have both kinds of ctor resp. dtor to tail call (or if not possible, just call) the other function. I guess it could have ABI consequences though (in which comdat section to place it).