summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-data-refs.c
diff options
context:
space:
mode:
authorbergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-03 14:02:13 +0000
committerbergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-03 14:02:13 +0000
commit618a6085f63455f5133da321449f440803367e42 (patch)
treeaaf50b3eaf544fd364f68471fa4b13bf590b6635 /gcc/tree-vect-data-refs.c
parent55e2967946fa4e76a345f55b84573400db096c2a (diff)
downloadgcc-618a6085f63455f5133da321449f440803367e42.tar.gz
Backport from mainline
2012-10-31 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/53708 * tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Preserve user-supplied alignment when used with an explicit section name. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@193121 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r--gcc/tree-vect-data-refs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 79c0f1dab7b..b08d7bbdcd1 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -4574,6 +4574,13 @@ 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 when an explicit
+ section name is also used. This is a common idiom used by many
+ software projects. */
+ if (DECL_SECTION_NAME (decl) != NULL_TREE
+ && !DECL_HAS_IMPLICIT_SECTION_NAME_P (decl))
+ return false;
+
if (TREE_STATIC (decl))
return (alignment <= MAX_OFILE_ALIGNMENT);
else