https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115021
--- Comment #4 from Hongtao Liu <liuhongt at gcc dot gnu.org> --- (In reply to Hu Lin from comment #3) > I found compiler allocates mem to the third source register of vpternlog in > IRA after commit f55cdce3f8dd8503e080e35be59c5f5390f6d95e. And it cause the > generate code will be > > 8 .cfi_startproc > 9 movl $4, %eax > 10 vpsraw $5, %xmm0, %xmm2 > 11 vpbroadcastb %eax, %xmm1 > 12 movl $7, %eax > 13 vpbroadcastb %eax, %xmm3 > 14 vmovdqa %xmm1, %xmm0 > 15 vpternlogd $120, %xmm3, %xmm2, %xmm0 > 16 vmovdqa %xmm3, -24(%rsp) > 17 vpsubb %xmm1, %xmm0, %xmm0 > 18 ret > > And 6a67fdcb3f0cc8be47b49ddd246d0c50c3770800 changes the vector type from > v16qi to v4si, leading to movv4si can't combine with the vpternlog in > postreload, so the result is what you see now. To clarify: The extra spill is caused by r14-4944-gf55cdce3f8dd85, r14-7026-g6a67fdcb3f0cc8 only causes an extra mov instruction(which is not a big deal).