Bug 26818 - [4.1/4.2 Regression] tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in finish_struct, at c-decl.c:5350 (time.c)
Summary: [4.1/4.2 Regression] tree check: expected class ‘type’, have ‘exceptional’ (e...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.1.0
: P2 minor
Target Milestone: 4.1.2
Assignee: Volker Reichelt
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: error-recovery, ice-checking, ice-on-invalid-code, monitored, patch
Depends on:
Blocks:
 
Reported: 2006-03-23 01:41 UTC by Flash Sheridan
Modified: 2006-05-29 07:10 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.1.0 4.2.0
Last reconfirmed: 2006-03-23 09:29:26


Attachments
Delta-reduced version (77 bytes, text/plain)
2006-03-23 01:43 UTC, Flash Sheridan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Flash Sheridan 2006-03-23 01:41:59 UTC
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
Comment 1 Flash Sheridan 2006-03-23 01:43:06 UTC
Created attachment 11101 [details]
Delta-reduced version
Comment 2 Richard Biener 2006-03-23 09:29:26 UTC
Confirmed.
Comment 3 Volker Reichelt 2006-03-27 20:03:44 UTC
Testing a patch.
Comment 4 patchapp@dberlin.org 2006-03-28 14:00:23 UTC
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
Comment 5 Volker Reichelt 2006-05-22 12:21:05 UTC
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

Comment 6 Volker Reichelt 2006-05-22 12:26:17 UTC
Fixed on mainline.
Waiting for the 4.1 branch to unfrezze.
Comment 7 Mark Mitchell 2006-05-25 02:34:15 UTC
Will not be fixed in 4.1.1; adjust target milestone to 4.1.2.
Comment 8 Volker Reichelt 2006-05-29 06:44:57 UTC
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

Comment 9 Volker Reichelt 2006-05-29 07:10:03 UTC
Now also fixed on the 4.1 branch.