]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/107160 - avoid reusing multiple accumulators
authorRichard Biener <rguenther@suse.de>
Thu, 13 Oct 2022 12:24:05 +0000 (14:24 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 17 Oct 2022 12:28:43 +0000 (14:28 +0200)
commitd282dd56275485a88e1fe9c4ae1939b62d23b20b
tree69a3c59a9734b61cc5bb10f6fe078c399fc1ddce
parentff0a274e5c3026b105c7f51126fa51f8178fa42c
tree-optimization/107160 - avoid reusing multiple accumulators

Epilogue vectorization is not set up to re-use a vectorized
accumulator consisting of more than one vector.  For non-SLP
we always reduce to a single but for SLP that isn't happening.
In such case we currenlty miscompile the epilog so avoid this.

PR tree-optimization/107160
* tree-vect-loop.cc (vect_create_epilog_for_reduction):
Do not register accumulator if we failed to reduce it
to a single vector.

* gcc.dg/vect/pr107160.c: New testcase.

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