Bug 16698 - [3.3/3.4/4.0 Regression] ICE with exceptions and declaration of __cxa_throw
Summary: [3.3/3.4/4.0 Regression] ICE with exceptions and declaration of __cxa_throw
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.3.4
: P2 normal
Target Milestone: 3.4.2
Assignee: Mark Mitchell
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2004-07-24 04:31 UTC by gkajmowi
Modified: 2004-10-30 21:11 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 2.95.3
Known to fail: 3.0.4 3.2.3 3.3.3 3.4.0 4.0.0
Last reconfirmed: 2004-07-26 00:06:23


Attachments
Preprocessed source (6.43 KB, application/octet-stream)
2004-07-24 04:32 UTC, gkajmowi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gkajmowi 2004-07-24 04:31:19 UTC
I am attempting to implement the standard C++ library  bit at a time, and the 
little bit I am compiling is giving me problems, segfaulting when compiling.

This has occurred with GC versions 3.3.3 and 3.3.4.  Please let me know what the 
problem is, and if it has been fixed in another version.  I am unwilling to 
corrupt my distribution by installing a non-available version of Gcc, but will 
wait for an appropriate version to be available.

Attached is the pre-preocessed source file.  The throw std::bad_cast(); line is 
the one which is causing problems.  throw int(5) causes the exact same problem.
Comment 1 gkajmowi 2004-07-24 04:32:22 UTC
Created attachment 6818 [details]
Preprocessed source

This is the preprocessed source requested to be submitted.
Comment 2 Andrew Pinski 2004-07-24 08:49:15 UTC
Confirmed, but I am thing this is invalid code as 3.2.3 ICE after an error but who knows.
Comment 3 Wolfgang Bangerth 2004-07-26 00:06:23 UTC
Indeed, this is a regression over 2.95 introduced with the new ABI. 
The ICE can be reduced to this: 
------------------- 
extern "C" void __cxa_throw (void *, void *,  void (*) (void *) ); 
 
void foo(){ 
        throw 1; 
} 
------------------- 
This ICEs everything since 3.2.3 and including mainline: 
 
x/gg> /home/bangerth/bin/gcc-3.5*/bin/c++ -c x.ii  
x.ii: In function `void foo()': 
x.ii:4: internal compiler error: Segmentation fault 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
It has something to do with the actual name of the function declaration, 
since if I change it the ICE goes away. 
 
W. 
Comment 4 Andrew Pinski 2004-07-29 14:41:29 UTC
: Search converges between 2001-03-25-trunk (#12) and 2001-04-01-trunk (#13).
Comment 5 Mark Mitchell 2004-08-12 01:12:05 UTC
Working on a fix.
Comment 6 GCC Commits 2004-08-12 05:17:46 UTC
Subject: Bug 16698

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-08-12 05:17:42

Modified files:
	gcc/cp         : ChangeLog except.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/eh: crash1.C 

Log message:
	PR c++/16698
	* except.c (build_throw): Allocate cleanup_type and the function
	for __cxa_throw separately.
	
	PR c++/16698
	* g++.dg/eh/crash1.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4271&r2=1.4272
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/except.c.diff?cvsroot=gcc&r1=1.171&r2=1.172
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4121&r2=1.4122
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/eh/crash1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 7 GCC Commits 2004-08-12 05:19:36 UTC
Subject: Bug 16698

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2004-08-12 05:19:31

Modified files:
	gcc/cp         : ChangeLog except.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/eh: crash1.C 

Log message:
	PR c++/16698
	* except.c (build_throw): Allocate cleanup_type and the function
	for __cxa_throw separately.
	
	PR c++/16698
	* g++.dg/eh/crash1.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.143&r2=1.3892.2.144
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/except.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.164.4.6&r2=1.164.4.7
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.246&r2=1.3389.2.247
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/eh/crash1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1

Comment 8 Mark Mitchell 2004-08-12 05:20:21 UTC
Fixed in GCC 3.4.2.