Re: [PATCH] Fix handling of non-integral bit-fields in native_encode_initializer

2023-05-23 Thread Eric Botcazou via Gcc-patches
> OK. Thanks! > Can we handle non-integer bitfields by recursing with a temporary buffer to > encode it byte-aligned and then apply shifting and masking to get it in > place? Or is that not worth it? Certainly doable, something along these lines is implemented in varasm.c to output these

Re: [PATCH] Fix handling of non-integral bit-fields in native_encode_initializer

2023-05-22 Thread Richard Biener via Gcc-patches
On Mon, May 22, 2023 at 10:10 AM Eric Botcazou via Gcc-patches wrote: > > Hi, > > the encoder for CONSTRUCTORs assumes that all bit-fields (DECL_BIT_FIELD) have > integral types, but that's not the case in Ada where they may have pretty much > any type, resulting in a wrong encoding for them. > >

[PATCH] Fix handling of non-integral bit-fields in native_encode_initializer

2023-05-22 Thread Eric Botcazou via Gcc-patches
Hi, the encoder for CONSTRUCTORs assumes that all bit-fields (DECL_BIT_FIELD) have integral types, but that's not the case in Ada where they may have pretty much any type, resulting in a wrong encoding for them. The attached fix filters out non-integral bit-fields, except if they start and end