]> 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>
Wed, 2 Apr 2025 12:00:18 +0000 (14:00 +0200)
commitd3e4c092c4f167d3c3ae8aa59d273b0202cef6cf
tree6452695c0a6d551a08492bac585bb5a23708a97e
parent85ed633f26c725bbe5c3a3c6fceada637bf33f7c
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.

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