https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126592
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-16 branch has been updated by Tamar Christina <[email protected]>: https://gcc.gnu.org/g:0edf69d035fc9f381e775011ac7174a3f9e826a7 commit r16-9982-g0edf69d035fc9f381e775011ac7174a3f9e826a7 Author: Tamar Christina <[email protected]> Date: Tue Aug 4 15:27:12 2026 +0100 vect: simplify is_linear_load_p using vec_perm_builder and reject invalid [PR126592] is_linear_load_p is supposed to test for valid permutations of lanes of complex arithmetic. It was written as a manual loop that iteratively discredited what a permutation could be and returned the permute. However the code is a bit hard to prove correct and as PR1265992 points out it accepts at least one invalid permute [0 2 2 2]. To fix this and simplify the code to prevent other issues I have rewritten it to use vec_perm_indices and use the convenient helper series_p (); gcc/ChangeLog: PR tree-optimization/126592 * tree-vect-slp-patterns.cc (is_linear_load_p): Rewrite using vec_perm_indices. gcc/testsuite/ChangeLog: PR tree-optimization/126592 * gcc.target/aarch64/pr126592.c: New test. (cherry picked from commit c3ceac8d1e1645cb5e7a2502ff17d9effce70699)
