re PR tree-optimization/65310 (vectorizer uses wrong alignment)

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

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

From-SVN: r221348
This commit is contained in:
Richard Biener 2015-03-11 15:09:51 +00:00 committed by Richard Biener
parent 25de0a29fb
commit 474b3a7c49
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2015-03-11 Richard Biener <rguenther@suse.de>
PR tree-optimization/65310
* tree-sra.c (build_ref_for_offset): Also preserve larger
alignment.
2015-03-11 Marat Zakirov <m.zakirov@samsung.com>
* asan.c (instrument_derefs): Disable instrumentation on asan-globals=0.

View File

@ -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);