https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86871
--- Comment #8 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> --- Author: rsandifo Date: Thu Aug 9 16:03:25 2018 New Revision: 263451 URL: https://gcc.gnu.org/viewcvs?rev=263451&root=gcc&view=rev Log: Allow inner-loop reductions with variable-length vectors While working on PR 86871, I noticed we were being overly restrictive when handling variable-length vectors. For: for (i : ...) { res = ...; for (j : ...) res op= ...; a[i] = res; } we don't need a reduction operation (although we do for double reductions like: res = ...; for (i : ...) for (j : ...) res op= ...; a[i] = res; which must still be rejected). 2018-08-08 Richard Sandiford <richard.sandif...@arm.com> gcc/ * tree-vect-loop.c (vectorizable_reduction): Allow inner-loop reductions for variable-length vectors. gcc/testsuite/ * gcc.target/aarch64/sve/reduc_8.c: New test. Added: trunk/gcc/testsuite/gcc.target/aarch64/sve/reduc_8.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-vect-loop.c