The file below causes "internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in finish_struct, at c-decl.c:5350" with a checking=all build of GCC 4.1.0 on both Ubuntu Linux 5.04 and Mac OSX 10.4.5. This is a Delta-reduced preprocessed version of the Linux kernel file arch/x86_64/kernel/time.c; it was originally compiled by a test script outside of the kernel tree, so it was presumably invalid C. struct acpi_table_rsdt { struct acpi_table_header header; } __attribute__ ((packed)); A checking=all build of GCC 4.0.2 correctly reports an error with no problem: /opt/gcc402-chk-all/bin/gcc ../cpp/bugfiles/GCC_bugfiles/error/122582_time_min.i ../cpp/bugfiles/GCC_bugfiles/error/122582_time_min.i:2: error: field ‘header’ has incomplete type This sounds somewhat like PR 22028, but that's marked as fixed in 4.1.0, and its testcase doesn't cause a problem on my builds of 4.1.0. Here's the session; I'll upload the file, though its complete contents are above. 78> /opt/gcc410-chk-all/bin/gcc -v ../cpp/bugfiles/GCC_bugfiles/error/122582_time_min.i Using built-in specs. Target: powerpc-apple-darwin8.5.0 Configured with: /opt/Gcc-4.1.0-dist/configure --enable-checking=all --prefix=/opt/gcc410-chk-all --enable-languages=c,c++ --with-comment=PalmSource checking=all build by Flash Sheridan 3/17/06 Thread model: posix gcc version 4.1.0 /opt/gcc410-chk-all/libexec/gcc/powerpc-apple-darwin8.5.0/4.1.0/cc1 -fpreprocessed ../cpp/bugfiles/GCC_bugfiles/error/122582_time_min.i -fPIC -quiet -dumpbase 122582_time_min.i -auxbase 122582_time_min -version -o /var/tmp//ccRoo730.s GNU C version 4.1.0 (powerpc-apple-darwin8.5.0) compiled by GNU C version 4.0.1 (Apple Computer, Inc. build 5247). GGC heuristics: --param ggc-min-expand=0 --param ggc-min-heapsize=0 Compiler executable checksum: 1116648296470812f723ca4bff2463c0 ../cpp/bugfiles/GCC_bugfiles/error/122582_time_min.i:2: error: field 'header' has incomplete type ../cpp/bugfiles/GCC_bugfiles/error/122582_time_min.i:3: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in finish_struct, at c-decl.c:5350 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. --- PalmSource bug 122582 http://pobox.com/~flash Quality Lead for Compilers and Debuggers PalmSource, Inc. Tools Quality Management
Created attachment 11101 [details] Delta-reduced version
Confirmed.
Testing a patch.
Subject: Bug number PR c/26818 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-03/msg01615.html
Subject: Bug 26818 Author: reichelt Date: Mon May 22 12:20:41 2006 New Revision: 113975 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113975 Log: PR c/26818 * c-decl.c (finish_struct): Skip erroneous fields. * gcc.dg/struct-incompl-1.c: New test. Added: trunk/gcc/testsuite/gcc.dg/struct-incompl-1.c Modified: trunk/gcc/ChangeLog trunk/gcc/c-decl.c trunk/gcc/testsuite/ChangeLog
Fixed on mainline. Waiting for the 4.1 branch to unfrezze.
Will not be fixed in 4.1.1; adjust target milestone to 4.1.2.
Subject: Bug 26818 Author: reichelt Date: Mon May 29 06:44:46 2006 New Revision: 114187 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114187 Log: PR c/26818 * c-decl.c (finish_struct): Skip erroneous fields. * gcc.dg/struct-incompl-1.c: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/struct-incompl-1.c Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/c-decl.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Now also fixed on the 4.1 branch.