Bug 29906 - [4.0 Regression] -g option creates internal compiler error
Summary: [4.0 Regression] -g option creates internal compiler error
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.1.2
: P1 normal
Target Milestone: 4.1.3
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2006-11-20 10:27 UTC by Axel Freyn
Modified: 2007-03-17 06:48 UTC (History)
3 users (show)

See Also:
Host: i486-linux-gnu
Target: i486-linux-gnu
Build: i486-linux-gnu
Known to work: 3.4.0
Known to fail: 4.0.4 4.1.2
Last reconfirmed: 2006-11-20 15:10:09


Attachments
testcase (78 bytes, text/plain)
2006-11-20 10:29 UTC, Axel Freyn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Axel Freyn 2006-11-20 10:27:23 UTC
without "-d" -option, the code compiles cleanly and works.
with "-d", the compiler crashs:
bug.cc:5: internal compiler error: in force_type_die, at dwarf2out.c:12904

the file bug.cc:

struct A{
  typedef int T;
  virtual ~A();
};
struct B:public A{
  using A::T;
};


The error occurs with versions
gcc version 4.1.2 20061028 (prerelease) (Debian 4.1.1-19)
gcc version 4.0.4 20060904 (prerelease) (Debian 4.0.3-7)
gcc version 4.1.0 (configured with: ../../gcc_download/gcc-4.1.0/configure --prefix=/home/abf/gcc --program-suffix=-4.1)

the older versions
gcc-Version 3.3.6 (Debian 1:3.3.6-13)
gcc-Version 3.4.6 (Debian 3.4.6-4)
work


the output of "gcc -v -save-temps -g bug.cc" is

Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c
++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/l
ib --without-included-gettext --enable-threads=posix --enable-nls --program-suff
ix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --en
able-mpfr --with-tune=i686 --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20061028 (prerelease) (Debian 4.1.1-19)
 /usr/lib/gcc/i486-linux-gnu/4.1.2/cc1plus -E -quiet -v -D_GNU_SOURCE bug.cc -mt
une=i686 -fworking-directory -fpch-preprocess -o bug.ii
ignoring nonexistent directory "/usr/local/include/i486-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../i4
86-linux-gnu/include"
ignoring nonexistent directory "/usr/include/i486-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2
 /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/i486-linux-gnu
 /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/backward
 /usr/local/include
 /usr/lib/gcc/i486-linux-gnu/4.1.2/include
 /usr/include
End of search list.
 /usr/lib/gcc/i486-linux-gnu/4.1.2/cc1plus -fpreprocessed bug.ii -quiet -dumpbas
e bug.cc -mtune=i686 -auxbase bug -g -version -o bug.s
GNU C++ version 4.1.2 20061028 (prerelease) (Debian 4.1.1-19) (i486-linux-gnu)
        compiled by GNU C version 4.1.2 20061028 (prerelease) (Debian 4.1.1-19).
GGC heuristics: --param ggc-min-expand=63 --param ggc-min-heapsize=63375
Compiler executable checksum: 0e07954a28908c1fdf868e745ba25559
bug.cc:5: internal compiler error: in force_type_die, at dwarf2out.c:12904
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>.
Preprocessed source stored into /tmp/cc0udwsp.out file, please attach this to yo
ur bugreport.
Comment 1 Axel Freyn 2006-11-20 10:29:09 UTC
Created attachment 12650 [details]
testcase
Comment 2 Andrew Pinski 2006-11-20 15:10:09 UTC
Confirmed.
Comment 3 Andrew Pinski 2006-11-20 15:11:17 UTC
Janis could you do a regression hunt to find what caused this bug and what also fixed this bug on the trunk?
Comment 4 Janis Johnson 2006-11-21 22:00:29 UTC
A regression hunt on powerpc-linux identified this patch for which the testcase started failing on mainline:

    http://gcc.gnu.org/viewcvs?view=rev&rev=76746

    r76746 | dpatel | 2004-01-27 20:36:02 +0000 (Tue, 27 Jan 2004)

Another regression hunt on powerpc-linux identified this patch for which the testcase started passing again on mainline:

    http://gcc.gnu.org/viewcvs?view=rev&rev=112360

    r112360 | carlos | 2006-03-24 21:17:41 +0000 (Fri, 24 Mar 2006)

Comment 5 Andrew Pinski 2006-11-22 04:30:45 UTC
-g -fno-emit-class-debug-always will produce the same effect on the mainline and the 4.2 branch so I am going to say this is still a 4.2/4.3 Regression.
Comment 6 Alexandre Oliva 2007-03-13 07:56:17 UTC
On it.
Comment 7 patchapp@dberlin.org 2007-03-13 09:14:05 UTC
Subject: Bug number PR29906

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-03/msg00817.html
Comment 8 Alexandre Oliva 2007-03-16 05:08:38 UTC
Subject: Bug 29906

Author: aoliva
Date: Fri Mar 16 05:08:25 2007
New Revision: 122976

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122976
Log:
gcc/ChangeLog:
PR debug/29906
* dwarf2out.c (force_type_die): Adjust comment.
(dwarf2out_imported_module_or_decl): Handle base AT_import types.
gcc/testsuite/ChangeLog:
PR debug/29906
* g++.dg/debug/pr29906.C: New

Added:
    trunk/gcc/testsuite/g++.dg/debug/pr29906.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c
    trunk/gcc/testsuite/ChangeLog

Comment 9 Alexandre Oliva 2007-03-16 05:09:05 UTC
Subject: Bug 29906

Author: aoliva
Date: Fri Mar 16 05:08:47 2007
New Revision: 122977

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122977
Log:
gcc/ChangeLog:
PR debug/29906
* dwarf2out.c (force_type_die): Adjust comment.
(dwarf2out_imported_module_or_decl): Handle base AT_import types.
gcc/testsuite/ChangeLog:
PR debug/29906
* g++.dg/debug/pr29906.C: New

Added:
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/debug/pr29906.C
Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/dwarf2out.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog

Comment 10 Alexandre Oliva 2007-03-17 03:48:59 UTC
Does anyone feel like testing the patch in 4.0?
Comment 11 Alexandre Oliva 2007-03-17 04:52:54 UTC
Subject: Bug 29906

Author: aoliva
Date: Sat Mar 17 04:52:44 2007
New Revision: 123011

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123011
Log:
gcc/ChangeLog:
PR debug/29906
* dwarf2out.c (force_type_die): Adjust comment.
(dwarf2out_imported_module_or_decl): Handle base AT_import types.
gcc/testsuite/ChangeLog:
PR debug/29906
* g++.dg/debug/pr29906.C: New

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/debug/pr29906.C
Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/dwarf2out.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog

Comment 12 Andrew Pinski 2007-03-17 06:48:06 UTC
Fixed.

> Does anyone feel like testing the patch in 4.0?
The 4.0 branch has been retired.