https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54700
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> --- This was missing a simple testcase, but now we can write one (in C++): typedef int vec __attribute__((vector_size(32))); vec f(vec x){ return x<0?2:1; } vpxor %xmm1, %xmm1, %xmm1 vpcmpgtd %ymm0, %ymm1, %ymm1 vmovdqa .LC1(%rip), %ymm0 vpblendvb %ymm1, .LC0(%rip), %ymm0, %ymm0 IIUC, we could skip vpcmpgtd and pass ymm0 directly to vpblendvb.