Bug 16792 - [4.0 regression] ICE in gen_subprogram_die, at dwarf2out.c:11267
Summary: [4.0 regression] ICE in gen_subprogram_die, at dwarf2out.c:11267
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Ben Elliston
URL:
Keywords: ice-on-valid-code, monitored
: 17659 18018 (view as bug list)
Depends on:
Blocks: 28677
  Show dependency treegraph
 
Reported: 2004-07-28 01:01 UTC by Paul Brook
Modified: 2006-08-10 23:25 UTC (History)
6 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work: 3.3.4 3.4.1
Known to fail: 4.0.0
Last reconfirmed: 2004-08-03 22:08:20


Attachments
preprocessed source (162.39 KB, text/plain)
2004-12-07 16:14 UTC, Michael Cieslinski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Brook 2004-07-28 01:01:27 UTC
The following program compiled with g++ -g gives 
internal compiler error: in gen_subprogram_die, at dwarf2out.c:11267 
 
struct S { S(); }; 
 
int foo (S b, double j) { }; 
int main () 
{ 
  int foo (S, double); 
  S v; 
}
Comment 1 Wolfgang Bangerth 2004-07-28 01:44:01 UTC
Indeed, a mainline regression. 
 
W. 
Comment 2 Andrew Pinski 2004-07-28 02:05:05 UTC
: Search converges between 2004-06-20-trunk (#469) and 2004-06-22-trunk (#470).
Comment 3 Andrew Pinski 2004-09-24 17:22:51 UTC
*** Bug 17659 has been marked as a duplicate of this bug. ***
Comment 4 Andrew Pinski 2004-10-15 17:41:15 UTC
*** Bug 18018 has been marked as a duplicate of this bug. ***
Comment 5 Andrew Pinski 2004-11-09 05:42:14 UTC
Hmm, a couple big things happened those two days, some should figure out which patch which caused 
this.
Comment 6 Volker Reichelt 2004-11-09 11:55:34 UTC
Zack, the regression appears with your patch
http://gcc.gnu.org/ml/gcc-cvs/2004-06/msg00815.html

Could you please have a look?
Comment 7 janis187 2004-12-04 01:19:29 UTC
Current mainline g++ ICEs in the same place (now dwarf2out.c:11210) when
compiling 252.eon with -g on powerpc64-unknown-linux-gnu with either -m32
or -m64.  Here's a testcase extracted from the eon code:

double foo (double);

void bar (double a)
{
    double foo (double);
    double x = foo (a);
}

double foo (double a)
{
    return 0.0;
}
Comment 8 Michael Cieslinski 2004-12-07 16:14:15 UTC
Created attachment 7700 [details]
preprocessed source

This ICE also occurs compiling qt-x11-free-3.3.3 with snapshot 20041205 on
x86_64:

g++40 -c -g -o qfont_x11.o qfont_x11.ii
kernel/qfont_x11.cpp: In member function 'void
QFontPrivate::load(QFont::Script)':
kernel/qfont_x11.cpp:426: internal compiler error: in gen_subprogram_die, at
dwarf2out.c:11210
Please submit a full bug report, with preprocessed source if appropriate.
Comment 9 porten 2004-12-21 07:14:16 UTC
Re comment #8: my report #18018 was actually in relation to exactly this file
from the Qt package. The test case is a destilled version.
Comment 10 Andrew Pinski 2005-01-02 02:55:44 UTC
It was caused by this part of the patch:
        * name-lookup.c (pushdecl): When a local extern shadows a
        file-scope declaration of the same object, give both DECLs the
        same DECL_UID.

the two DECLs have the same UID so we get the same die but the decls are not connect any other way
so this is C++ front-end bug.
Comment 11 Volker Reichelt 2005-01-07 10:02:37 UTC
Fixed on mainline by Dan's patch for PR 19267:
http://gcc.gnu.org/ml/gcc-cvs/2005-01/msg00198.html

I checked all three testcases (original testcase and the ones in
comments #7 and #8).
Comment 12 CVS Commits 2005-03-13 22:18:08 UTC
Subject: Bug 16792

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	bje@gcc.gnu.org	2005-03-13 22:17:59

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/debug: pr16792.C 

Log message:
	PR debug/16792
	* g++.dg/debug/pr16792.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5158&r2=1.5159
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/debug/pr16792.C.diff?cvsroot=gcc&r1=NONE&r2=1.1