[Bug middle-end/126410] vectorizer aligns 16-byte array to 64byte

"rguenth at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126410

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
The issue is that we call ensure_base_align when costing only.  Fix:

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 488b9754bed..c5a86d3a1a4 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -8304,7 +8304,8 @@ vectorizable_store (vec_info *vinfo,

   /* Transform.  */

-  ensure_base_align (dr_info);
+  if (!costing_p)
+    ensure_base_align (dr_info);

   if (STMT_VINFO_SIMD_LANE_ACCESS_P (stmt_info) >= 3)
     {
@@ -9986,7 +9987,8 @@ vectorizable_load (vec_info *vinfo,
   /* Transform.  */

   dr_vec_info *dr_info = STMT_VINFO_DR_INFO (stmt_info), *first_dr_info =
NULL;
-  ensure_base_align (dr_info);
+  if (!costing_p)
+    ensure_base_align (dr_info);

   if (memory_access_type == VMAT_INVARIANT)
     {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.