[Bug middle-end/113574] wrong code with shift and _BitInt(1) at any opt level
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jan 24 06:52:51 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113574
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note I was thinking I might hit this with 1 sized bit field but that seems to
work:
```
struct f
{
unsigned ub1:1;
}t;
void
foo(unsigned short ub16)
{
t.ub1 = (ub16 << 2);
}
int
main(void)
{
unsigned short t2 = 0xfef1;
foo(t2);
if (t.ub1)
__builtin_abort();
return 0;
}
```
More information about the Gcc-bugs
mailing list