https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70421
--- Comment #3 from Zdenek Sojka <zsojka at seznam dot cz> --- (In reply to Jakub Jelinek from comment #2) > Untested fix: > --- gcc/config/i386/i386.c (revision 234449) > +++ gcc/config/i386/i386.c (working copy) > @@ -46930,7 +46930,7 @@ half: > { > tmp = gen_reg_rtx (mode); > emit_insn (gen_rtx_SET (tmp, gen_rtx_VEC_DUPLICATE (mode, val))); > - emit_insn (gen_blendm (target, tmp, target, > + emit_insn (gen_blendm (target, target, tmp, > force_reg (mmode, > gen_int_mode (1 << elt, mmode)))); > } Thanks, that fixes the testcase and some other miscompiles. I haven't run the testsuite though. Is the fact that the useless cast in: x ^= ((v16si)v)[u[0]]; changes the generated code (makes it significantly worse at all opt levels) worth creating a PR?