Don't try to vectorise COND_EXPR reduction chains (PR 84913)
authorRichard Sandiford <richard.sandiford@linaro.org>
Sun, 18 Mar 2018 10:25:29 +0000 (10:25 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sun, 18 Mar 2018 10:25:29 +0000 (10:25 +0000)
commit928b965f29f587bb033555f0db646c94afe8e7ef
tree0e183b4538fea404815ada3c300fd059d50a5e8e
parent4a8298b46d966bcc979bb170b32a163db235f1b5
Don't try to vectorise COND_EXPR reduction chains (PR 84913)

The testcase ICEd for both SVE and AVX512 because we were trying
to vectorise a chain of COND_EXPRs as a reduction and getting
confused by reduc_index == -1.

2018-03-18  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
PR tree-optimization/84913
* tree-vect-loop.c (vectorizable_reduction): Don't try to
vectorize chains of COND_EXPRs.

gcc/testsuite/
PR tree-optimization/84913
* gfortran.dg/vect/pr84913.f90: New test.

From-SVN: r258631
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/vect/pr84913.f90 [new file with mode: 0644]
gcc/tree-vect-loop.c