[PATCH, GCC 4.7] Backport fix for PR tree-optimization/53708
Peter Bergner
bergner@vnet.ibm.com
Thu Nov 1 02:54:00 GMT 2012
On Wed, 2012-10-31 at 09:02 -0500, Peter Bergner wrote:
> On Wed, 2012-10-31 at 14:55 +0100, Jakub Jelinek wrote:
> > On Wed, Oct 31, 2012 at 08:53:31AM -0500, Peter Bergner wrote:
> > > Great. Jakub, were you going to commit your change or did you want me
> > > to do that?
> >
> > I haven't tested it, you did, so please do that yourself. Thanks.
>
> I tested it on FSF 4.7. I'll do a quick trunk bootstrap/regtest and
> commit it when it passes. Thanks.
Ok, committed as revision 193058. I'll wait a few days before committing
it to the FSF 4.7 branch. For completeness, the patch I committed is
attached below.
Peter
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.
Index: gcc/tree-vect-data-refs.c
===================================================================
--- gcc/tree-vect-data-refs.c (revision 193057)
+++ gcc/tree-vect-data-refs.c (revision 193058)
@@ -4858,6 +4858,13 @@
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
More information about the Libc-alpha
mailing list