tree-optimization/111764 - wrong reduction vectorization
commit05f98310b54da95e468d799f4a910174320cccbb
authorRichard Biener <rguenther@suse.de>
Thu, 12 Oct 2023 07:09:46 +0000 (12 09:09 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 12 Oct 2023 08:18:56 +0000 (12 10:18 +0200)
tree8991bc3bf65e3225de1113cc02a71e242bb26915
parent5fbd91b12cd3e7b178842bf5624bdcd316832012
tree-optimization/111764 - wrong reduction vectorization

The following removes a misguided attempt to allow x + x in a reduction
path, also allowing x * x which isn't valid.  x + x actually never
arrives this way but instead is canonicalized to 2 * x.  This makes
reduction path handling consistent with how we handle the single-stmt
reduction case.

PR tree-optimization/111764
* tree-vect-loop.cc (check_reduction_path): Remove the attempt
to allow x + x via special-casing of assigns.

* gcc.dg/vect/pr111764.c: New testcase.
gcc/testsuite/gcc.dg/vect/pr111764.c [new file with mode: 0644]
gcc/tree-vect-loop.cc