https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119096

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm testing

diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index dc15b955aad..52533623cab 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -9064,7 +9064,7 @@ vect_transform_reduction (loop_vec_info loop_vinfo,
            new_stmt = gimple_build_call_internal (internal_fn (code),
                                                   op.num_ops,
                                                   vop[0], vop[1], vop[2],
-                                                  vop[1]);
+                                                  vop[reduc_index]);
          else
            new_stmt = gimple_build_assign (vec_dest, tree_code (op.code),
                                            vop[0], vop[1], vop[2]);

Reply via email to