https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106097
--- Comment #5 from Xi Ruoyao <xry111 at mengyan1223 dot wang> --- And it actually does not need a reproducer: "x << 32 >> 32" for sign-extension is undefined by C++ standard if x is negative: > The value of E1 << E2 is E1 left-shifted E2 bit positions; vacated bits are > zero-filled. If E1 has an unsigned type, the value of the result is > E1 × 2^{E2}, reduced modulo one more than the maximum value representable in > the result type. Otherwise, if E1 has a signed type and non-negative value, > and E1 × 2^{E2} is representable in the corresponding unsigned type of the > result type, then that value, converted to the result type, is the resulting > value; otherwise, the behavior is undefined. And the result of right shifting negative numbers is implementation-defined (zext or sext), though GCC always uses sext.