This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: sdbout.c tree check error
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 26 Mar 2004 16:09:24 -0500
- Subject: Re: sdbout.c tree check error
- References: <200403262103.i2QL3ldu015537@greed.delorie.com>
DJ Delorie <dj@redhat.com> writes:
> --host=i686-pc-linux-gnu
> --target=i586-pc-msdosdjgpp
>
> In file included from ./tm.h:5,
> from /greed/dj/djgpp/gcc/gcc/libgcc2.c:43:
> /greed/dj/djgpp/gcc/gcc/config/i386/i386.h:1283: internal compiler error: tree check: expected record_type, union_type or qual_union_type; have enumeral_type in sdbout_one_type, at sdbout.c:1189
>
> i386.h points at the end of a typedef enum; the sdbout code looks like this:
>
> if (TREE_CODE (type) == ENUMERAL_TYPE)
> {
> for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem))
>
> This code is many years old.
>
> Ideas?
I suspect that the loop should use TYPE_VALUES rather than
TYPE_FIELDS. They reference the same field in the structure, so it
would presumably work without checking, but TYPE_VALUES is for enums
and TYPE_FIELDS is for struct, etc.
Ian