Bug 11995 - [3.3/3.4 Regression] Error recovery problem after invalid labelled declaration in c99 mode
Summary: [3.3/3.4 Regression] Error recovery problem after invalid labelled declaratio...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 3.4.0
: P2 minor
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2003-08-20 19:29 UTC by Falk Hueffner
Modified: 2004-01-17 04:22 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-12-19 07:15:10


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Falk Hueffner 2003-08-20 19:29:00 UTC
falk@juist:/tmp% cat test.c
void f ()
{
 l: int;
}

falk@juist:/tmp% gcc -v -std=c99 -c test.c 
Reading specs from
/usr/local/stow/gcc-2003.08.19/bin/../lib/gcc/alphaev68-unknown-linux-gnu/3.4/specs
Configured with: ../configure --disable-nls --enable-languages=c++
Thread model: posix
gcc version 3.4 20030819 (experimental)
 /usr/local/stow/gcc-2003.08.19/bin/../libexec/gcc/alphaev68-unknown-linux-gnu/3.4/cc1 -quiet -v -iprefix /usr/local/stow/gcc-2003.08.19/bin/../lib/gcc/alphaev68-unknown-linux-gnu/3.4/ test.c -quiet -dumpbase test.c -mcpu=ev67 -auxbase test -std=c99 -version -o /tmp/ccfMHVFe.s
ignoring nonexistent directory
"/usr/local/stow/gcc-2003.08.19/bin/../lib/gcc/alphaev68-unknown-linux-gnu/3.4/../../../../alphaev68-unknown-linux-gnu/include"
ignoring nonexistent directory "NONE/include"
ignoring duplicate directory
"/usr/local/lib/gcc/alphaev68-unknown-linux-gnu/3.4/include"
ignoring nonexistent directory
"/usr/local/lib/gcc/alphaev68-unknown-linux-gnu/3.4/../../../../alphaev68-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/stow/gcc-2003.08.19/bin/../lib/gcc/alphaev68-unknown-linux-gnu/3.4/include
 /usr/local/include
 /usr/include
End of search list.
GNU C version 3.4 20030819 (experimental) (alphaev68-unknown-linux-gnu)
        compiled by GNU C version 3.4 20030819 (experimental).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64064
test.c: In function `f':

test.c:3: error: syntax error before "int"
test.c:4: internal compiler error: tree check: expected block, have error_mark
in finish_function, at c-decl.c:6089
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Andrew Pinski 2003-08-20 19:34:53 UTC
I can confirm this on the mainline (20030820).  If checking is turned off we get a stack overflow.
Comment 2 Dara Hazeghi 2003-08-23 01:24:50 UTC
Does it ICE on the branch too?
Comment 3 Andrew Pinski 2003-08-23 14:26:45 UTC
From Phil's regression hunter: Search converges between 2001-06-03-trunk (#22) and 
2001-06-10-trunk (#23). 
Comment 4 Mark Mitchell 2003-09-05 05:30:24 UTC
This is an ICE after a valid error, so I've pushed it back to GCC 3.4.
Comment 5 Steven Bosscher 2003-12-23 10:04:20 UTC
Looks fixed to me. 
 
$ ../cc1 --version 
GNU C version 3.4.0 20031223 (experimental) (i686-pc-linux-gnu) 
        compiled by GNU C version 3.4.0 20031223 (experimental). 
GGC heuristics: --param ggc-min-expand=56 --param ggc-min-heapsize=50000 
$ ../cc1 -std=c99 t.c 
 f 
 
t.c: In function `f': 
t.c:3: error: parse error before "int" 
 
Execution times (seconds) 
 parser                :   0.01 (50%) usr   0.00 ( 0%) sys   0.01 (50%) wall 
 TOTAL                 :   0.02             0.00             0.02 
$  
Comment 6 Andrew Pinski 2003-12-23 10:18:06 UTC
Fixed by me via the C99 fix, will add a testcase.
Comment 7 GCC Commits 2003-12-23 10:33:05 UTC
Subject: Bug 11995

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2003-12-23 10:33:01

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: 20031223-1.c 

Log message:
	2003-12-21  Andrew Pinski  <pinskia@physics.uc.edu>
	
	PR c/11995
	* gcc.dg/20031223-1.c: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3304&r2=1.3305
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/20031223-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1