Bug 7083 - ICE using -gstabs with dodgy class derivation
Bug#: 7083 Product:  gcc Version: 3.1
Host:  Target:  Build: 
Status: RESOLVED Severity: normal Priority: P3
Resolution: FIXED Assigned To: unassigned@gcc.gnu.org Reported By: dmonksfd@broadcom.com
Component: c++ Target Milestone: 3.3.1
Summary: ICE using -gstabs with dodgy class derivation
Keywords:  ice-on-valid-code, monitored
Opened: 2002-06-20 03:36
Description:   Last confirmed: 2003-06-23 11:16 Opened: 2002-06-20 03:36
gcc -v:
    Reading specs from /tools/gcc/3.1/i686-2.4.7-10/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
    Configured with: ../gcc-3.1/configure --prefix=/tools/gcc/3.1 --exec-prefix=/tools/gcc/3.1/i686-2.4.7-10 --disable-nls --enable-shared
    Thread model: single
    gcc version 3.1

Command line:
    g++ -gstabs -c gcc31bug.cc

Output:
    gcc31bug.cc:5: internal error: Segmentation fault
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

Preprocessed source:
    # 1 "gcc31bug.cc"
    # 1 "<built-in>"
    # 1 "<command line>"
    # 1 "gcc31bug.cc"
    typedef struct {
        int x;
    } A;

    class B: public A {
        int y;
    };

Notes:
    This is nasty (probably invalid) code, but it works
    under -ggdb, and probably shouldn't segfault anyway.

Release:
3.1

------- Comment #1 From Kriang Lerdsuwanakij 2002-10-26 07:30 -------
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirm.

------- Comment #2 From Volker Reichelt 2003-05-06 18:17 -------
From: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
To: gcc-gnats@gcc.gnu.org, dmonksfd@broadcom.com, gcc-bugs@gcc.gnu.org
Cc:  
Subject: Re: c++/7083: [2003-01-22] ICE using -gstabs with dodgy class
 derivation
Date: Tue, 06 May 2003 18:17:47 +0200 (CEST)

 GCC crashes at least since 2.95.x on the code.
 This affects also 3.3 branch and mainline as of 2003-05-06.
 
 BTW, the code looks legal to me.
 
 Regards,
 Volker
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7083

------- Comment #3 From Andrew Pinski 2003-07-11 12:42 -------
*** Bug 8446 has been marked as a duplicate of this bug. ***

------- Comment #4 From Andrew Pinski 2003-07-11 15:08 -------
This also fails in 3.2.2 and 3.2.3.

------- Comment #5 From Andrew Pinski 2003-07-16 04:39 -------
Most likely the same fix for bug 11473, fixed this bug.  I will submit a
testcase when I get 
cvs access.