From af4d0d913bb41215875b7e9e668009ba98d973e6 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Tue, 19 Jun 2012 09:19:07 +0000 Subject: [PATCH] re PR middle-end/53708 (Many failures of the objc tests with -O3 -fnext-runtime and -m32) 2012-06-19 Richard Guenther PR tree-optimization/53708 * tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Preserve user-supplied alignment and alignment of decls with the used attribute. From-SVN: r188771 --- gcc/ChangeLog | 7 +++++++ gcc/tree-vect-data-refs.c | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0055ebf90b1..df128a42693 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-06-19 Richard Guenther + + PR tree-optimization/53708 + * tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Preserve + user-supplied alignment and alignment of decls with the used + attribute. + 2012-06-18 Lawrence Crowl * timevar.def (TV_PHASE_GENERATE): Rename to TV_PHASE_LATE_ASM. diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 29dff45482b..e12fddceb66 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -4731,6 +4731,12 @@ vect_can_force_dr_alignment_p (const_tree decl, unsigned int alignment) if (TREE_ASM_WRITTEN (decl)) return false; + /* Do not override explicit alignment set by the user or the alignment + as specified by the ABI when the used attribute is set. */ + if (DECL_USER_ALIGN (decl) + || DECL_PRESERVE_P (decl)) + return false; + if (TREE_STATIC (decl)) return (alignment <= MAX_OFILE_ALIGNMENT); else