The following fixes an oversight triggering after the recent change
to bump_vector_ptr.

Bootstrapped on x86_64-unknown-linux-gnu, pushed.

        PR tree-optimization/106387
        * tree-vect-stmts.cc (vectorizable_load): Use make_ssa_name
        if ptr is not an SSA name.
---
 gcc/tree-vect-stmts.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 01d982eea98..f582d238984 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -10017,7 +10017,10 @@ vectorizable_load (vec_info *vinfo,
                                 (NULL_TREE, BIT_AND_EXPR, ptr,
                                  build_int_cst
                                  (TREE_TYPE (ptr), -(HOST_WIDE_INT) align));
-                   ptr = copy_ssa_name (ptr, new_stmt);
+                   if (TREE_CODE (ptr) == SSA_NAME)
+                     ptr = copy_ssa_name (ptr, new_stmt);
+                   else
+                     ptr = make_ssa_name (TREE_TYPE (ptr), new_stmt);
                    gimple_assign_set_lhs (new_stmt, ptr);
                    vect_finish_stmt_generation (vinfo, stmt_info,
                                                 new_stmt, gsi);
-- 
2.35.3

Reply via email to