This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ENUM_BITFIELD and -fshort-enums


On Thu, Dec 09, 2004 at 12:46:14PM -0500, Daniel Jacobowitz wrote:
> I tried to build a native arm-unknown-linux-gnueabi compiler yesterday.
> The only major problem was the fact that EABI defaults to
> -fshort-enums.  rtl.h has this:
> 
>   /* The kind of expression this is.  */
>   ENUM_BITFIELD(rtx_code) code: 16;
> 
> But since there are only 164 RTL codes at present, with -fshort-enums
> the underlying type of enum rtx_code is "char".  So GCC gives an error
> that the bitfield is wider than its type.
> 
> For now I'm just using an x-linuxeabi file which builds GCC using
> -fno-short-enums, but that's not a good solution.  Should this bitfield
> be allowed?

Other alternative fixes:

  - Add an RTX code with value 65535 to force the enum to be large
    enough.
  - Shrink the bitfield and leave 8 bits of padding in struct rtx_def.

-- 
Daniel Jacobowitz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]