sdbout.c tree check error

Ian Lance Taylor ian@wasabisystems.com
Fri Mar 26 22:43:00 GMT 2004


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



More information about the Gcc mailing list