I get an internal compiler error using the debian 3.4.1-2 version. I don't get it using 3.3.4. I also get the same error using the gcc snapsnot (3.5.0 20040717) I get the same error on i386 and x86_64/amd64. I only get the error when using -g1, using -g0 it works. It does not depend on the -O level used. I've also filed a bug at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=260710 which has a preprocessed file attached to it. Kurt
Confirmed. I'll try to shrink it. W.
Confirmed, here is the reduced source: int t() { static int g() {return 0;} return g(); } I hate nested functions.
That one was actually easy: ------------------- void foo (void) { void nested () {} } ------------------- g/x> /home/bangerth/bin/gcc-3.4-pre/bin/gcc -g1 -c x.i x.i: In function `foo': x.i:3: internal compiler error: in gen_subprogram_die, at dwarf2out.c:10831 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. W.
Oh, I see Andrew found it easy, too :-) Too bad to be beaten by a mere 3 minutes...
: Search converges between 2003-04-11-trunk (#226) and 2003-04-12-trunk (#227).
Zack, the regression was introduced by your patch http://gcc.gnu.org/ml/gcc-cvs/2003-04/msg00555.html Could you please have a look?
Postponed until GCC 3.4.3.
Fixed on mainline by Jan's patch for PR 16460 http://gcc.gnu.org/ml/gcc-cvs/2004-09/msg00904.html Jan, do you think the relevant stuff can be backported to 3.4?
It is not feasable to backport his fix as uses the unnessted functions which were added for tree-ssa.
Postponed until GCC 3.4.4.
*** Bug 21457 has been marked as a duplicate of this bug. ***
Note that the use of -g1 on glibc NPTL build is a debian rule, I don't know if anybody else does that and I don't know why they do that, some obscure comment seem to imply it is to get unwind informations.
Zack, this is a regression of part of your c-decl stuff. Can you possibly give it a look? It breaks builds of glibc on primary platforms.
Ben Elliston just produced a patch for it that I tested. It fixed building of glibc on debian powerpc with -g1 (used by debian rules for nptl). The patch is on it's way to the patch list (which didn't catch up yet it seems). The patch is very simple, it just causes gcc to emit more debug infos in the case of nested functions (like the -g2 case) instead of trying to be smart.
Subject: Bug 16676 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: bje@gcc.gnu.org 2005-05-10 00:01:46 Modified files: gcc : ChangeLog dwarf2out.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg/debug: pr16676.c Log message: PR debug/16676 * dwarf2out.c (dwarf2out_decl): Always set context_die to NULL, even when debug_info_level is DINFO_LEVEL_TERSE. [testsuite] * gcc.dg/debug/pr16676.c: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.858&r2=2.2326.2.859 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dwarf2out.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.478.2.16&r2=1.478.2.17 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.392&r2=1.3389.2.393 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/debug/pr16676.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
Patch approved by rth and committed.
Ben, your patch doesn't really solve the problem. I still get the ICE on the 3.4 branch when I compile the testcase with -g1.
Subject: Re: [3.4 Regression] ICE with nested functions and -g1, blocks glibc > Ben, your patch doesn't really solve the problem. > I still get the ICE on the 3.4 branch when I compile the testcase with -g1. A number of people discovered some regressions that I missed, so I have backed the patch out for now.
Created attachment 9006 [details] OpenPGP digital signature
As this _only_ happens with -O1 -g1 (not -O2 -g1, nor -O1 -g) this is surely not critical (anymore anyways). Re-confirmed on 3.4.4 though. Also this is likely not to be fixed.
*** Bug 24304 has been marked as a duplicate of this bug. ***
won't fix for 3.4.6.