From 474b3a7c49a5ccd6a8becb7f7c5ae6c9e74f36ca Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 11 Mar 2015 15:09:51 +0000 Subject: [PATCH] re PR tree-optimization/65310 (vectorizer uses wrong alignment) 2015-03-11 Richard Biener PR tree-optimization/65310 * tree-sra.c (build_ref_for_offset): Also preserve larger alignment. From-SVN: r221348 --- gcc/ChangeLog | 6 ++++++ gcc/tree-sra.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4a7f7881472..3e91636b16d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-03-11 Richard Biener + + PR tree-optimization/65310 + * tree-sra.c (build_ref_for_offset): Also preserve larger + alignment. + 2015-03-11 Marat Zakirov * asan.c (instrument_derefs): Disable instrumentation on asan-globals=0. diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 3527a47256c..a49e9504e12 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -1597,7 +1597,7 @@ build_ref_for_offset (location_t loc, tree base, HOST_WIDE_INT offset, 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); -- 2.30.2