https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81835
--- Comment #1 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> --- Author: rsandifo Date: Wed Aug 16 07:51:13 2017 New Revision: 251117 URL: https://gcc.gnu.org/viewcvs?rev=251117&root=gcc&view=rev Log: PR81815: Invalid conditional reduction We weren't checking whether the phi in a conditional reduction was used by the condition itself (which isn't a case we handle). 2017-08-11 Richard Sandiford <richard.sandif...@linaro.org> gcc/ PR tree-optimization/81835 * tree-vect-loop.c (vect_is_simple_reduction): Simply checks for the phi SSA_NAME. Check that the condition in a COND_EXPR does not depend on the phi. gcc/testsuite/ PR tree-optimization/81835 * gcc.dg/vect/pr81815.c: New test. Added: trunk/gcc/testsuite/gcc.dg/vect/pr81815.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-vect-loop.c