[committed,vect] Only change base alignment if more restrictive
diff mbox series

Message ID a21270a0-be44-4ce5-f0ba-5544baaef8b7@arm.com
State New
Headers show
Series
  • [committed,vect] Only change base alignment if more restrictive
Related show

Commit Message

Andre Vieira (lists) Oct. 21, 2019, 10:13 a.m. UTC
Hi all,

This patch was pre-approved by richi.  This patch makes sure 
ensure_base_align only changes alignment if the new alignment is more 
restrictive.  It already did this if we were dealing with symbols, but 
it now does it for all types of declarations.

Committed in revision r277238.

Cheers,
Andre

2019-10-21  Andre Vieira  <andre.simoesdiasvieira@arm.com>

         * tree-vect-stmts (ensure_base_align): Only change alignment if new
         alignment is more restrictive.

Patch
diff mbox series

diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index e606945d536ad3353b2317aed5b504a89eec9fc3..a3f99eecdf0976147ddd48725d62b9f18aea08cd 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -6288,7 +6288,7 @@  ensure_base_align (dr_vec_info *dr_info)
 
       if (decl_in_symtab_p (base_decl))
 	symtab_node::get (base_decl)->increase_alignment (align_base_to);
-      else
+      else if (DECL_ALIGN (base_decl) < align_base_to)
 	{
 	  SET_DECL_ALIGN (base_decl, align_base_to);
           DECL_USER_ALIGN (base_decl) = 1;