https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93418
--- Comment #8 from Devin Hussey <husseydevin at gmail dot com> --- Seems to work. ~ $ ~/gcc-test/bin/x86_64-pc-cygwin-gcc.exe -mavx2 -O3 _mm_sllv_bug.c ~ $ ./a.exe Without optimizations (correct result): ffff0000 80000000 00000000 fffffff8 With optimizations (incorrect result): ffff0000 80000000 00000000 fffffff8 ~ $ And checking the assembly, the shifts are constant propagated. The provided test file also passes.