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

--- Comment #5 from Sam James <sjames at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> I think the bug is in vectorizable_load where memory_access_type might be
> uninitialized.
> 
>   vect_memory_access_type memory_access_type;

I'll play with this:

--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -9413,7 +9413,7 @@ vectorizable_load (vec_info *vinfo,
   else
     group_size = 1;

-  vect_memory_access_type memory_access_type;
+  vect_memory_access_type memory_access_type = undef_vect_memory_access_type;
   enum dr_alignment_support alignment_support_scheme;
   int misalignment;
   poly_int64 poffset;

--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -173,6 +173,8 @@ struct vect_scalar_ops_slice_hash :
typed_noop_remove<vect_scalar_ops_slice>
 /* Describes how we're going to vectorize an individual load or store,
    or a group of loads or stores.  */
 enum vect_memory_access_type {
+  undef_vect_memory_access_type = 0,
+
   /* An access to an invariant address.  This is used only for loads.  */
   VMAT_INVARIANT,

and see what else falls out.

Reply via email to