summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorbergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-01 02:48:07 +0000
committerbergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-01 02:48:07 +0000
commitce281ff30962b2b133ebf345e4a8654ad39ad768 (patch)
treee8a046ccfe6058ad71ebb7cc94207dd63b12ae0d /gcc
parentad20e16565562dbeed844b6c317e7f980da5e0d0 (diff)
downloadgcc-ce281ff30962b2b133ebf345e4a8654ad39ad768.tar.gz
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/trunk@193058 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-vect-data-refs.c7
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9db326f627a..53df5c052a4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2012-10-31 Dehao Chen <dehao@google.com>
* tree-eh.c (do_return_redirection): Set location for jump statement.
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 5866b0652d0..445f2cbe712 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -4858,6 +4858,13 @@ vect_can_force_dr_alignment_p (const_tree decl, unsigned int alignment)
if (DECL_PRESERVE_P (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