Don't try to vectorise COND_EXPR reduction chains (PR 84913)
commit29844e5f8a353c67f6e39b97322e23d7ba03f8d4
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 18 Mar 2018 10:25:29 +0000 (18 10:25 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 18 Mar 2018 10:25:29 +0000 (18 10:25 +0000)
tree0e183b4538fea404815ada3c300fd059d50a5e8e
parent9269f78b59b7eb1a7deccc80344ca849481d9d5b
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@258631 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/vect/pr84913.f90 [new file with mode: 0644]
gcc/tree-vect-loop.c