On Sat, Dec 6, 2025 at 11:21 AM Jakub Jelinek <[email protected]> wrote:
>
> On Sat, Dec 06, 2025 at 11:17:11AM +0100, Richard Biener wrote:
> > > The following testcase ICEs since checking has been added to
> > > TYPE_PRECISION
> > > macro. check_bitfield_type_and_width is called when attributes haven't
> > > been applied to the bit-field decl yet and so it still has INTEGER_TYPE
> > > type, while at finish_struct time it already has VECTOR_TYPE.
> > >
> > > The following patch just repeats the check_bitfield_type_and_width
> > > in there.
> > >
> > > Another option would be let handle_vector_size_attribute check for
> > > bit-fields and error out there.
> >
> > I think we try to do that there but 8 bits of precision fail to be catched?
>
> Nothing checks it there. The C FE does the checking before applying
> the attributes and updates the type to the width precision only
> in finish_struct after that happens.
Ah, yeah, now I remember, the attribute handler cannot see this is a bitfield.
> struct S { int : 7 __attribute__((vector_size (32))); };
> ICEs the same way.
> Though, I think the C++ FE applies the attributes before the checking,
> and DECL_INITIAL on FIELD_DECLs means there something completely different
> (NSDMI).
>
> Jakub
>