https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66866
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- "Safe" fix: Index: gcc/config/i386/i386.c =================================================================== --- gcc/config/i386/i386.c (revision 225768) +++ gcc/config/i386/i386.c (working copy) @@ -50528,7 +50528,11 @@ ix86_expand_pinsr (rtx *operands) } if (GET_CODE (src) == SUBREG) - src = SUBREG_REG (src); + { + if (SUBREG_BYTE (src) != 0) + return false; + src = SUBREG_REG (src); + } switch (GET_MODE (dst)) { but with awful consequences for code-generation (-O2, for the reduced testcase): _Z4shufDv2_x: .LFB0: .cfi_startproc pxor %xmm1, %xmm1 movabsq $-4294901761, %rdx movaps %xmm0, -24(%rsp) movq -16(%rsp), %rax movaps %xmm1, -24(%rsp) movzwl %ax, %eax salq $16, %rax movq -16(%rsp), %rcx andq %rcx, %rdx orq %rax, %rdx movq %rdx, -16(%rsp) movdqa -24(%rsp), %xmm0 ret