PR81815: Invalid conditional reduction
authorRichard Sandiford <richard.sandiford@linaro.org>
Wed, 16 Aug 2017 07:51:13 +0000 (07:51 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 16 Aug 2017 07:51:13 +0000 (07:51 +0000)
commit963aeaad25122bc507f9c72b9af6fc13cbeccde4
tree9c24e2074a1675f8b8a339be48ef9450a724feaf
parent60e095de004cd024b67875f3c1d2a382feba7cce
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.

From-SVN: r251117
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr81815.c [new file with mode: 0644]
gcc/tree-vect-loop.c