Bug 30382 - [4.1 Regression] ICE in build_enumerator, at cp/decl.c:10111
Summary: [4.1 Regression] ICE in build_enumerator, at cp/decl.c:10111
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.2
: P3 major
Target Milestone: 4.1.2
Assignee: Jakub Jelinek
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2007-01-05 12:29 UTC by Richard Biener
Modified: 2007-01-05 16:54 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.1.1
Known to fail: 4.1.2
Last reconfirmed: 2007-01-05 13:44:57


Attachments
gcc41-pr30382.patch (450 bytes, patch)
2007-01-05 14:56 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2007-01-05 12:29:00 UTC
 
Comment 1 Richard Biener 2007-01-05 12:31:35 UTC
I see

                === g++ tests ===


Running target unix
FAIL: g++.dg/parse/enum3.C  (test for errors, line 3)
FAIL: g++.dg/parse/enum3.C (test for excess errors)
FAIL: g++.old-deja/g++.bugs/900405_01.C  (test for errors, line 15)
FAIL: g++.old-deja/g++.bugs/900405_01.C  (test for errors, line 16)
FAIL: g++.old-deja/g++.bugs/900405_01.C  (test for errors, line 17)
FAIL: g++.old-deja/g++.jason/cond.C  (test for errors, line 49)
FAIL: g++.old-deja/g++.jason/cond.C  (test for errors, line 52)

on i686-pc-linux-gnu.  All of the above are like

/home/richard/src/gcc-4_1-branch/gcc/testsuite/g++.old-deja/g++.jason/cond.C:41: internal compiler error: tree check: expected enumeral_type, have error_mark in build_enumerator, at cp/decl.c:10111
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

this is a regression on the branch.
Comment 2 Richard Biener 2007-01-05 12:40:45 UTC
Reverting

Author: jakub
Date: Wed Jan  3 08:13:50 2007
New Revision: 120392

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120392
Log:
	PR c++/29535
	Backported from mainline
	2006-10-17  Mark Mitchell  <mark@codesourcery.com>
	PR c++/28261
	* parser.c (cp_lexer_next_token_is_decl_specifier_keyword): New
	function.
	(cp_parser_constructor_declarator_p): Use it.
	(cp_parser_check_type_definition): Return a value indicating
	whether or not the definition is valid.
	(cp_parser_enum_specifier): Skip invalid enum definitions.

	PR c++/28261
	* g++.dg/parse/enum3.C: New test.

	PR c++/29535
	* g++.dg/template/crash66.C: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/parse/enum3.C
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/crash66.C
Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/parser.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog

fixes the problems.
Comment 3 Eric Botcazou 2007-01-05 13:17:31 UTC
>                 === g++ tests ===
> 
> 
> Running target unix
> FAIL: g++.dg/parse/enum3.C  (test for errors, line 3)
> FAIL: g++.dg/parse/enum3.C (test for excess errors)
> FAIL: g++.old-deja/g++.bugs/900405_01.C  (test for errors, line 15)
> FAIL: g++.old-deja/g++.bugs/900405_01.C  (test for errors, line 16)
> FAIL: g++.old-deja/g++.bugs/900405_01.C  (test for errors, line 17)
> FAIL: g++.old-deja/g++.jason/cond.C  (test for errors, line 49)
> FAIL: g++.old-deja/g++.jason/cond.C  (test for errors, line 52)
> 
> on i686-pc-linux-gnu.

Yup, and on x86-64 too.
Comment 4 Jakub Jelinek 2007-01-05 13:44:57 UTC
Sorry, I have mistakenly bootstrapped this with the default checking
(i.e. --enable-checking=release).
Comment 5 Eric Botcazou 2007-01-05 13:47:23 UTC
> Sorry, I have mistakenly bootstrapped this with the default checking
> (i.e. --enable-checking=release).

Richard's log is actually --enable-checking=release.  With tree checking

                === g++ tests ===


Running target unix
FAIL: g++.dg/parse/enum3.C (internal compiler error)
FAIL: g++.dg/parse/enum3.C  (test for errors, line 3)
FAIL: g++.dg/parse/enum3.C (test for excess errors)
XPASS: g++.dg/tree-ssa/pr14814.C scan-tree-dump-times &this 0
FAIL: g++.old-deja/g++.bugs/900405_01.C (internal compiler error)
FAIL: g++.old-deja/g++.bugs/900405_01.C  (test for errors, line 15)
FAIL: g++.old-deja/g++.bugs/900405_01.C  (test for errors, line 16)
FAIL: g++.old-deja/g++.bugs/900405_01.C  (test for errors, line 17)
FAIL: g++.old-deja/g++.jason/cond.C (internal compiler error)
FAIL: g++.old-deja/g++.jason/cond.C  (test for errors, line 49)
FAIL: g++.old-deja/g++.jason/cond.C  (test for errors, line 52)
Comment 6 Jakub Jelinek 2007-01-05 14:18:40 UTC
http://gcc.gnu.org/viewcvs?view=rev&revision=115086
Hope it is enough to put in just the 4 lines...
Comment 7 Jakub Jelinek 2007-01-05 14:56:58 UTC
Created attachment 12859 [details]
gcc41-pr30382.patch
Comment 8 Jakub Jelinek 2007-01-05 16:53:40 UTC
Subject: Bug 30382

Author: jakub
Date: Fri Jan  5 16:53:27 2007
New Revision: 120490

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120490
Log:
	PR c++/30382
	Backported from mainline:
	2006-06-29  Jason Merrill  <jason@redhat.com>
	* parser.c (cp_parser_enum_specifier): Return early if
	type is error_mark_node.

Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/parser.c

Comment 9 Jakub Jelinek 2007-01-05 16:54:13 UTC
Fixed.