]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/119096 - bogus conditional reduction vectorization
authorRichard Biener <rguenther@suse.de>
Mon, 3 Mar 2025 13:12:37 +0000 (14:12 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 4 Mar 2025 08:24:31 +0000 (09:24 +0100)
commit10e4107dfcf9fe324d0902f16411a75c596dab91
treedf339b4f6fb5d02ab85e4a2887cc557e32337fd2
parentbfb9276f344cbc6794379d61d0279dfc3a7441b3
tree-optimization/119096 - bogus conditional reduction vectorization

When we vectorize a .COND_ADD reduction and apply the single-use-def
cycle optimization we can end up chosing the wrong else value for
subsequent .COND_ADD.  The following rectifies this.

PR tree-optimization/119096
* tree-vect-loop.cc (vect_transform_reduction): Use the
correct else value for .COND_fn.

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