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.
Created attachment 12650 [details] testcase
Confirmed.
Janis could you do a regression hunt to find what caused this bug and what also fixed this bug on the trunk?
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)
-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.
On it.
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
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
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
Does anyone feel like testing the patch in 4.0?
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
Fixed. > Does anyone feel like testing the patch in 4.0? The 4.0 branch has been retired.