https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101922
--- Comment #2 from Xi Ruoyao <xry111 at mengyan1223 dot wang> --- A "legal" testcase w/o UB (and may have some usage in practice): typedef __INT8_TYPE__ i8; typedef __INT32_TYPE__ i32; i8 d[16]; i32 f(i32 x) { int i; for (i = 0; i < 16; i++) { __INT32_TYPE__ t = (__INT32_TYPE__) d[i] >> 31; x &= t; } return x; }