This fixes a vectorizer testcase regression on powerpc where SRA
drops alignment info unnecessarily.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2015-03-11  Richard Biener  <rguent...@suse.de>

        PR tree-optimization/65310
        * tree-sra.c (build_ref_for_offset): Also preserve larger
        alignment.

Index: gcc/tree-sra.c
===================================================================
--- gcc/tree-sra.c      (revision 221324)
+++ gcc/tree-sra.c      (working copy)
@@ -1597,7 +1597,7 @@ build_ref_for_offset (location_t loc, tr
   misalign = (misalign + offset) & (align - 1);
   if (misalign != 0)
     align = (misalign & -misalign);
-  if (align < TYPE_ALIGN (exp_type))
+  if (align != TYPE_ALIGN (exp_type))
     exp_type = build_aligned_type (exp_type, align);
 
   mem_ref = fold_build2_loc (loc, MEM_REF, exp_type, base, off);

Reply via email to