https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111811

--- Comment #4 from joseph at codesourcery dot com <joseph at codesourcery dot 
com> ---
The checks are in check_bitfield_type_and_width.  I expect the attribute - 
in this position a declaration attribute - gets applied after that (and 
while applying it results in a change to the type, and thus in the 
declaration being laid out again, this check doesn't get repeated).

In this case, the existing check is correct but not sufficient.  In 
another case the check is arguably too early:

struct s { int __attribute__ ((__mode__ (DI))) x : 50; };

Considering int __attribute__ ((__mode__ (DI))) as a DImode integer type, 
that bit-field width is valid - but it's rejected because the check is 
carried out on int, before the attribute gets applied.  Getting that case 
to work might require extracting early those declaration attributes that 
actually affect the type, so they can be applied to the type before the 
declaration gets constructed and such checks are carried out.
  • [Bug c/111811] [14 Regression]... joseph at codesourcery dot com via Gcc-bugs

Reply via email to