https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70944
--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> --- A new test-case: $ cat ice.ii unsigned *a; void fn1 () { for (int i; i; ++i) { unsigned g (a[i] << 8 >> 24); a[i] = g; } } $ gcc ice.ii -O3 -march=core-avx2 ice.ii: In function ‘void fn1()’: ice.ii:10:1: internal compiler error: in immed_wide_int_const, at emit-rtl.c:606 } ^ 0xa89680 immed_wide_int_const(generic_wide_int<wide_int_ref_storage<false> > const&, machine_mode) ../../gcc/emit-rtl.c:606 0x140f721 change_zero_ext ../../gcc/combine.c:11140 0x1410568 recog_for_combine ../../gcc/combine.c:11177 0x141ee4c try_combine ../../gcc/combine.c:3503 0x1424868 combine_instructions ../../gcc/combine.c:1288 0x1424868 rest_of_handle_combine ../../gcc/combine.c:14377 0x1424868 execute ../../gcc/combine.c:14420 I'm going to test Richi's suggestion.