]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/111764 - wrong reduction vectorization
authorRichard Biener <rguenther@suse.de>
Thu, 12 Oct 2023 07:09:46 +0000 (09:09 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 10 Nov 2023 13:23:27 +0000 (14:23 +0100)
commitdb010f96743a4f289975a0432209c38ec34635e9
tree6d18130d120879879286a1a3617eb8116f1037a7
parent8e8599fc8079cdc2a9ef934c765613e2f0a4cdf9
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.

(cherry picked from commit 05f98310b54da95e468d799f4a910174320cccbb)
gcc/testsuite/gcc.dg/vect/pr111764.c [new file with mode: 0644]
gcc/tree-vect-loop.cc