First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 8564
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: ron@vaniwaarden.org
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
jj.C jj.C application/octet-stream 2003-05-21 15:16 93.26 KB Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 8564 depends on: Show dependency tree
Show dependency graph
Bug 8564 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: Opened: 2002-11-13 11:56
g++ 3.2 crashes on the attached file

[vaniwaar@vaniwaar-w2k ~]$ g++-3.2 -c jj.C
jj.C: In function `void __static_initialization_and_destruction_0(int, int)':
jj.C:29675: Internal compiler error in find_function_data, at function.c:329
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

Release:
g++-3.2 (GCC) 3.2

Environment:
RH Linux 7.3

How-To-Repeat:
Simply compile the attached file

------- Comment #1 From ron@vaniwaarden.org 2002-11-13 11:56 -------
Fix:
Please!  :-)

------- Comment #2 From Volker Reichelt 2002-11-14 01:59 -------
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed.
    
    The bug can be demonstrated with the following code snippet:
    
    ----------------------------snip here--------------------------
    class A { static char* p; };
    
    int i = 1;
    char* A::p = new char[i];
    
    class B { B(); };
    
    B::B() {}
    ----------------------------snip here--------------------------
    
    This crashes gcc 3.0.x, 3.1 - 3.2.1, and mainline (just compile with
    g++ -c) - with gcc 2.95.x, however, the code compiles fine.
    So this is a regression from 2.95.x.
    
    A workaround is to write "new char[1]" instead of "new char[i]"
    (i.e. replace line 29675 by
      char* SpParmSetDataItem::ret = new char[30];
    in the file jj.C).

------- Comment #3 From Volker Reichelt 2002-11-14 12:21 -------
From: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
To: gcc-gnats@gcc.gnu.org, vaniwaar@ca.metsci.com, ron@vaniwaarden.org,
        gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/8564: internal compiler error in find_function_data, at function.c:329 with  g++ 3.2
Date: Thu, 14 Nov 2002 12:21:58 +0100

 Hi,
 
 here's an even shorter example:
 
 ----------------------------snip here--------------------------
 struct A { static char* p; };
 
 int i = 1;
 char* A::p = new char[i];
 
 void foo() {}
 ----------------------------snip here--------------------------
 
 BTW, the same bug was reported in PR 7473.
 
 Greetings,
 Volker
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7473
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8564
 
 


------- Comment #4 From Wolfgang Bangerth 2002-12-12 10:04 -------
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/8564
Date: Thu, 12 Dec 2002 10:04:47 -0600 (CST)

 This patchset:
 > 2001-01-03  Jason Merrill  <jason@redhat.com>
 >
 >       * init.c (build_default_init): New fn.
 >       (perform_member_init): Split out from here.
 >       (build_new_1): Use it.  Simplify initialization logic.
 >       (build_vec_init): Take an array, rather than a pointer and maxindex.
 >       Speed up simple initializations.  Don't clean up if we're assigning.
 >       * cp-tree.h: Adjust.
 >       * decl2.c (do_static_initialization): Remove TREE_VEC case.
 >       * parse.y (new_initializer): Return void_zero_node for ().
 >       * typeck.c (build_modify_expr): Handle getting a CONSTRUCTOR.
 >       * typeck2.c (digest_init): Only complain about user-written
 >       CONSTRUCTORs.
 
 is causing high priority regression PR 8564. The testcase for this PR is
 ------------------------
 struct A { static char* p; };
 
 int i = 1;
 char* A::p = new char[i];
 
 void foo() {}
 ------------------------
 
 It fails like so:
 bash-2.05$ ../gcc/bin-2001-01-02/gcc/cc1plus -O -quiet PR8564.cc
 PR8564.cc: In function `void __static_initialization_and_destruction_0(int, int)':
 PR8564.cc:8: Internal compiler error in find_function_data, at function.c:327
 Please submit a full bug report.
  See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
 
 Regards
   Wolfgang
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                                www: http://www.ticam.utexas.edu/~bangerth
 
 
 


------- Comment #5 From Jason Merrill 2003-01-17 03:43 -------
From: jason@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/8564
Date: 17 Jan 2003 03:43:53 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	jason@gcc.gnu.org	2003-01-16 19:43:52
 
 Added files:
 	gcc/testsuite/g++.dg/init: new3.C 
 
 Log message:
 	PR c++/8564
 	* init.c (build_vec_init): Re-add maxindex parm.
 	(perform_member_init, build_aggr_init): Pass it.
 	(build_new_1): Pass it. Use an incomplete array type for full_type.
 	* typeck.c (build_modify_expr): Pass it.
 	* cp-tree.h: Adjust.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/new3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 


------- Comment #6 From Jason Merrill 2003-01-17 03:43 -------
From: jason@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/8564
Date: 17 Jan 2003 03:43:53 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	jason@gcc.gnu.org	2003-01-16 19:43:53
 
 Modified files:
 	gcc/cp         : ChangeLog cp-tree.h init.c typeck.c 
 
 Log message:
 	PR c++/8564
 	* init.c (build_vec_init): Re-add maxindex parm.
 	(perform_member_init, build_aggr_init): Pass it.
 	(build_new_1): Pass it. Use an incomplete array type for full_type.
 	* typeck.c (build_modify_expr): Pass it.
 	* cp-tree.h: Adjust.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3163&r2=1.3164
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.801&r2=1.802
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&r1=1.305&r2=1.306
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.444&r2=1.445
 


------- Comment #7 From Jason Merrill 2003-01-17 03:44 -------
From: jason@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/8564
Date: 17 Jan 2003 03:44:10 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	jason@gcc.gnu.org	2003-01-16 19:44:10
 
 Modified files:
 	gcc/cp         : ChangeLog cp-tree.h init.c typeck.c 
 
 Log message:
 	PR c++/8564
 	* init.c (build_vec_init): Re-add maxindex parm.
 	(perform_member_init, build_aggr_init): Pass it.
 	(build_new_1): Pass it. Use an incomplete array type for full_type.
 	* typeck.c (build_modify_expr): Pass it.
 	* cp-tree.h: Adjust.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.17&r2=1.3076.2.18
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.776.2.3&r2=1.776.2.4
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.299&r2=1.299.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.436&r2=1.436.2.1
 


------- Comment #8 From Wolfgang Bangerth 2003-02-19 08:10 -------
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: Steven Bosscher <s.bosscher@student.tudelft.nl>
Cc: gcc-gnats@gcc.gnu.org, <gcc-bugs@gcc.gnu.org>, <jason@gcc.gnu.org>
Subject: Re: c++/8564: [3.2/3.3/3.4 regression] ICE in find_function_data,
 at function.c:329
Date: Wed, 19 Feb 2003 08:10:46 -0600 (CST)

 > Can this PR be closed?  Its "sibling" PR 7473 has already been closed
 > and it seems this bug was fixed some time ago, too.
 
 I can confirm that it is fixed on 3.3 and mainline, but it is not fixed on 
 3.2 branch. I'd be happy to close it, but we need agreement that it will 
 not be fixed on 3.2 any more (where it is a regression as well). I have 
 adapted the synposis in the meantime, to reflect this.
 
 Jason, you wrote the fix. Is there any chance of rolling it over to the 
 branch, or is this too invasive?
 
 W.
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth             email:            bangerth@ticam.utexas.edu
                               www: http://www.ticam.utexas.edu/~bangerth/
 
 

------- Comment #9 From s.bosscher@student.tudelft.nl 2003-02-19 13:13 -------
From: Steven Bosscher <s.bosscher@student.tudelft.nl>
To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org,
	gcc-prs@gcc.gnu.org
Cc: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
Subject: Re: c++/8564: [3.2/3.3/3.4 regression] ICE in find_function_data,
	at function.c:329
Date: 19 Feb 2003 13:13:10 +0100

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8564
 
 Can this PR be closed?  Its "sibling" PR 7473 has already been closed
 and it seems this bug was fixed some time ago, too.
 
 The ChangeLog entry for the fix is in cp/ChangeLog, so maybe it was not
 recognised by the "cvs commit" machinery??
 
 Greetz
 Steven
 
 


------- Comment #10 From Joe Buck 2003-04-25 19:41 -------
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed for 3.3 and mainline; 3.2 branch is now closed.

------- Comment #11 From Jorn Wolfgang Rennecke 2005-03-21 19:24 -------
(In reply to comment #7)
>  	* init.c ...
>  	(build_new_1): ... Use an incomplete array type for full_type.

This change has caused PR c++/20427.
The following variant of the reduced testcase also changed from ICE to wrong-code:

 struct A { static char* p; };
 
 int i = 1;
 char* A::p = new char[i] ();
 
 void foo() {}

First Last Prev Next    No search results available      Search page      Enter new bug