PR81815: Invalid conditional reduction
commited3fa54b0b0bac3c62aeaf9a483c918075b91b3c
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 Aug 2017 07:51:13 +0000 (16 07:51 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 Aug 2017 07:51:13 +0000 (16 07:51 +0000)
tree9c24e2074a1675f8b8a339be48ef9450a724feaf
parentc75fa14ffcc7665a7a3afe23b40f3db0bb7976a1
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.sandiford@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.

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