https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123175
--- Comment #17 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by Alex Coplan <[email protected]>: https://gcc.gnu.org/g:bebd813a40070519311222bb997d10fc31672d73 commit r15-10975-gbebd813a40070519311222bb997d10fc31672d73 Author: Richard Biener <[email protected]> Date: Fri Jan 9 09:35:21 2026 +0100 middle-end/123175 - fix parts of const VEC_PERM with relaxed input sizes The following fixes enough of const VEC_PERM folding and lowering to deal with the fallout for the two testcases from the PR. We usually do not generate such problematic VEC_PERM expressions, but we allow those since GCC 14. As can be seen we mishandle those, including failure to expand/lower them by zero-extending inputs (which is what __builtin_shufflevector does). I'm unsure as to what extent we get such permutes but Tamar indicates that aarch64 can handle those at least. PR middle-end/123175 * match.pd (vec_perm @0 @1 @2): Fixup for inputs having a different number of elements than the result. * tree-vect-generic.cc (lower_vec_perm): Likewise. * gcc.dg/torture/pr123175-1.c: New testcase. * gcc.dg/torture/pr123175-2.c: Likewise. (cherry picked from commit a4716ece529dfd29d169ccc96979f7c747231f25)
