This happened in real code, where a required header file was missing.
$ cat bug.i
void f() {
char x[g(h)];
}
$ gcc-4.4.2 -c bug.i
bug.i: In function f:
bug.i:2: error: h undeclared (first use in this function)
bug.i:2: error: (Each undeclared identifier is reported only once
bug.i:2: error: for each function it appears in.)
bug.i:2: internal compiler error: tree check: expected class type, have
exceptional (error_mark) in create_tmp_var, at gimplify.c:555
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.gentoo.org/> for instructions.
The same thing happens with a 4.5 snapshot from 20091001; I haven't yet been
able to try a more recent snapshot.
--
Summary: ICE on invalid variable length array declaration
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: truedfx at gentoo dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41842