https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99212
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target| |cris-elf
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Just to repeat - we have folding that turns BIT_FIELD_REF <bits, 8, 0> into
VIEW_CONVERT_EXPR <type> (bits) if the size of bits is the size of the
extracted
bits which, for cris likely means that sizeof (ubits) is 1. To quote
struct ubits
{
unsigned int b0 : 1;
unsigned int b123 : 3;
unsigned int b456 : 3;
unsigned int b7 : 1;
};
to make the IL the same for both targets it might be enough to insert padding:
struct ubits
{
unsigned int b0 : 1;
unsigned int b123 : 3;
unsigned int b456 : 3;
unsigned int b7 : 1;
unsigned int pad : 24; // or 8
};
xfail/pass depending on sizeof (int) might be possible but as said it might
be that cris doesn't have sizeof (int) == 1 but instead just lays out
struct ubits in a way to have its size being 1.