From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16944 invoked by alias); 20 Nov 2012 17:15:08 -0000 Received: (qmail 15802 invoked by uid 48); 20 Nov 2012 17:14:21 -0000 From: "andy.m.jost at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/54770] sibling call optimization is not applied where it ought to be Date: Tue, 20 Nov 2012 17:15: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: X-Bugzilla-Severity: normal X-Bugzilla-Who: andy.m.jost at gmail dot com 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-11/txt/msg01944.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54770 --- Comment #8 from Andy Jost 2012-11-20 17:14:18 UTC --- The workaround I mentioned in comment #5 does seem to do the trick. Specifically, something like this works in all the cases I've tried: struct MainNode : Node { virtual void H() { helper() this->H(); } __attribute__((noinline)) void helper() { NodePtr tmp(arg); this->~Node(); new(this) MainNode(tmp); } };