Bug 17424 - [4.0 regression] ICE with sizeof an undeclared variable
Summary: [4.0 regression] ICE with sizeof an undeclared variable
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.0.0
: P2 minor
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-checking, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2004-09-11 23:56 UTC by Volker Reichelt
Modified: 2004-09-19 20:31 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-09-12 00:25:51


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2004-09-11 23:56:11 UTC
Here's a (symmetric) testcase that crashes mainline:

============================
;int foezis = sizeof tni;
============================

:1:c.c:1: error: 'tni' undeclared here (not in a function)
:1:c.c:1: internal compiler error: tree check: expected class 't', have 'x'
(error_mark) in c_expr_sizeof_expr, at c-typeck.c:1854
Please submit a full bug report, [etc.]
Comment 1 Andrew Pinski 2004-09-12 00:05:09 UTC
: Search converges between 2004-09-07-trunk (#536) and 2004-09-10-trunk (#537).


Confirmed.

Comment 2 Steven Bosscher 2004-09-12 00:25:51 UTC
looks like Joseph is to blame...? 
Comment 3 Wolfgang Bangerth 2004-09-12 23:12:03 UTC
Hey, Volker, you're getting good at that! :-) 
Comment 4 GCC Commits 2004-09-18 18:28:20 UTC
Subject: Bug 17424

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jsm28@gcc.gnu.org	2004-09-18 18:28:14

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

Log message:
	PR c/17424
	* c-typeck.c (c_expr_sizeof_expr): Check for error_mark_node.
	
	testsuite:
	* gcc.dg/pr17424-1.c: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5514&r2=2.5515
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&r1=1.375&r2=1.376
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4313&r2=1.4314
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr17424-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 5 Andrew Pinski 2004-09-19 20:31:47 UTC
Fixed.