From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20358 invoked by alias); 14 Feb 2003 20:46:19 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 20337 invoked by uid 48); 14 Feb 2003 20:46:19 -0000 Date: Fri, 14 Feb 2003 20:46:00 -0000 Message-ID: <20030214204619.20336.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, stefan@space.twc.de From: bangerth@dealii.org Reply-To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, stefan@space.twc.de, gcc-gnats@gcc.gnu.org Subject: Re: c++/9629: [3.2/3.3/3.4 regression] virtual inheritance segfault X-SW-Source: 2003-02/txt/msg00619.txt.bz2 List-Id: Old Synopsis: virtual inheritance segfault New Synopsis: [3.2/3.3/3.4 regression] virtual inheritance segfault State-Changed-From-To: open->analyzed State-Changed-By: bangerth State-Changed-When: Fri Feb 14 20:46:18 2003 State-Changed-Why: Confirmed. Here's a very slightly reduced testcase: -------------------------- struct A { }; struct B { B(A *) {} }; struct C : virtual public A, public B { C() : B(this) {} }; struct D : virtual public C {}; main() { new D(); } ------------------------ Executing this program segfaults with 3.2.2, 3.3, and 3.4. So it is a regression, assuming the code is legal. The problem is in casting this to A* in the constructor C::C. It's trying to cast to a virtual base, and it seems to me that this information is not available at the time we get to C::C, which then causes the segfault. But that's just a wild guess. W. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9629