https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123175
--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <[email protected]>: https://gcc.gnu.org/g:a4716ece529dfd29d169ccc96979f7c747231f25 commit r16-6709-ga4716ece529dfd29d169ccc96979f7c747231f25 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.
