https://gcc.gnu.org/g:52d3352239f73d3c165550177b4fe917760b85f9

commit r16-322-g52d3352239f73d3c165550177b4fe917760b85f9
Author: Richard Biener <rguent...@suse.de>
Date:   Thu Jan 30 15:37:05 2025 +0100

    Fixup vect_remove_slp_scalar_calls
    
    There's a logic error for vect_remove_slp_scalar_calls where it
    simply ignores pattern stmts but it should instead look at the
    original stmt.
    
            * tree-vect-slp.cc (vect_remove_slp_scalar_calls): Look
            at the original stmt.

Diff:
---
 gcc/tree-vect-slp.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index b5a9604d074e..9bf142d0faf5 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -11361,12 +11361,12 @@ vect_remove_slp_scalar_calls (vec_info *vinfo,
     {
       if (!stmt_info)
        continue;
+      if (!PURE_SLP_STMT (stmt_info))
+       continue;
+      stmt_info = vect_orig_stmt (stmt_info);
       gcall *stmt = dyn_cast <gcall *> (stmt_info->stmt);
       if (!stmt || gimple_bb (stmt) == NULL)
        continue;
-      if (is_pattern_stmt_p (stmt_info)
-         || !PURE_SLP_STMT (stmt_info))
-       continue;
       lhs = gimple_call_lhs (stmt);
       if (lhs)
        new_stmt = gimple_build_assign (lhs, build_zero_cst (TREE_TYPE (lhs)));

Reply via email to