https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110717
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Improved testcase which shows similar behavior also with bitfields:
#ifdef __SIZEOF_INT128__
#define type __int128
#define N 59
#else
#define type long long
#define N 27
#endif
struct S { type a : sizeof (type) * __CHAR_BIT__ - N; };
unsigned type
foo (unsigned type x)
{
x <<= N;
return ((type) x) >> N;
}
unsigned type
bar (struct S *p)
{
return p->a;
}
