Even when we emit scalar stores we should pass down the SLP node.

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

        PR tree-optimization/121350
        * tree-vect-stmts.cc (vectorizable_store): Pass down SLP
        node when costing scalar stores in vect_body.
---
 gcc/tree-vect-stmts.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 83b35608c60..5b363bb6a4d 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -8245,7 +8245,7 @@ vectorizable_store (vec_info *vinfo,
              else
                inside_cost
                  += record_stmt_cost (cost_vec, n_adjacent_stores,
-                                      scalar_store, stmt_info, 0, vect_body);
+                                      scalar_store, slp_node, 0, vect_body);
              /* Only need vector extracting when there are more
                 than one stores.  */
              if (nstores > 1)
-- 
2.43.0

Reply via email to