[Bug target/67246] MIPS: lw (load word) is generated for byte bitfield, leading to unaligned access
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Sep 2 03:32:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67246
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jeff Hansen from comment #8)
> Why would this be a bug in the kernel?
>
> Why is gcc trying to load a word or short when it's a 4-bit bitfield?? So
> you're recommending that we add __attribute__((packed)) to the struct? Is
> there any other way/option to change this behavior?
Because it is sometimes more efficent to use a wider access than a narrorer one
for bitfields.
There is no other option since the original struct is 4 byte aligned.
More information about the Gcc-bugs
mailing list