https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126592
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tamar Christina <[email protected]>: https://gcc.gnu.org/g:c3ceac8d1e1645cb5e7a2502ff17d9effce70699 commit r17-2948-gc3ceac8d1e1645cb5e7a2502ff17d9effce70699 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.
