On the 3.4 branch I get a segfault for the following invalid code snippet: ============================= void foo() { __PRETTY_FUNCTION__; ============================= bug.c: In function `foo': bug.c:3: error: parse error at end of input bug.c:3: internal compiler error: Segmentation fault Please submit a full bug report, [etc.] Mainline and 4.0 barnch are not affected.
Confirmed, here is the backtrace: #0 0x0806ac39 in finish_fname_decls () at ../../gcc/c-common.c:1047 #1 0x0804f7f6 in c_parse_file () at c-parse.y:3036 #2 0x0807f3b2 in c_common_parse_file (set_yydebug=0) at ../../gcc/c-opts.c:1237 #3 0x0827606d in toplev_main (argc=0, argv=0xbfffec7a) at ../../gcc/toplev.c:1822
Testing a patch.
Subject: Bug 22458 CVSROOT: /cvs/gcc Module name: gcc Changes by: rsandifo@gcc.gnu.org 2005-08-08 07:38:30 Modified files: gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg: pr22458-1.c Log message: PR c/22458 * gcc.dg/pr22458-1.c: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5890&r2=1.5891 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr22458-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 22458 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: rsandifo@gcc.gnu.org 2005-08-08 07:40:09 Modified files: gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg: pr22458-1.c Log message: PR c/22458 * gcc.dg/pr22458-1.c: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.320&r2=1.5084.2.321 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr22458-1.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
Subject: Bug 22458 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: rsandifo@gcc.gnu.org 2005-08-08 07:42:37 Modified files: gcc : ChangeLog c-decl.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg: pr22458-1.c Log message: PR c/22458 * c-decl.c (c_begin_compound_stmt): Set the initial body to error_mark_node, not NULL. 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.903&r2=2.2326.2.904 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.470.4.21&r2=1.470.4.22 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.418&r2=1.3389.2.419 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr22458-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.4.1
Patch applied to 3.4. Testcase also applied to mainline and 4.0.