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.
Created attachment 6818 [details] Preprocessed source This is the preprocessed source requested to be submitted.
Confirmed, but I am thing this is invalid code as 3.2.3 ICE after an error but who knows.
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.
: Search converges between 2001-03-25-trunk (#12) and 2001-04-01-trunk (#13).
Working on a fix.
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
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
Fixed in GCC 3.4.2.