https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94509
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 48225 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48225&action=edit gcc10-pr94509.patch Untested fix. The if (vmode == V32QImode) { /* vpshufb only works intra lanes, it is not possible to shuffle bytes in between the lanes. */ for (i = 0; i < nelt; ++i) if ((d->perm[i] ^ i) & (nelt / 2)) return false; } intra-lane check which has been correct has been copied and adjusted for 64-byte modes into: if (vmode == V64QImode) { /* vpshufb only works intra lanes, it is not possible to shuffle bytes in between the lanes. */ for (i = 0; i < nelt; ++i) if ((d->perm[i] ^ i) & (nelt / 4)) return false; } which is not correct, because 64-byte modes have 4 lanes rather than just two and the above is only testing that the permutation grabs even lane elts from even lanes and odd lane elts from odd lanes, but not that they are from the same 256-bit half.