This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH, GCC 4.7] Backport fix for PR tree-optimization/53708
- From: Peter Bergner <bergner at vnet dot ibm dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Wed, 31 Oct 2012 21:54:09 -0500
- Subject: Re: [PATCH, GCC 4.7] Backport fix for PR tree-optimization/53708
- References: <1351616337.4778.7.camel@otta.rchland.ibm.com> <1351622613.4778.21.camel@otta.rchland.ibm.com> <20121030185535.GV1752@tucnak.redhat.com> <1351623824.4778.27.camel@otta.rchland.ibm.com> <20121030193731.GX1752@tucnak.redhat.com> <1351628621.4778.29.camel@otta.rchland.ibm.com> <CAFiYyc3ndT3EXdNkqcZNzO9BmVjZgev+1CxJAPiw0CjTMtoirg@mail.gmail.com> <1351691611.4619.3.camel@otta> <20121031135555.GJ1752@tucnak.redhat.com> <1351692147.4619.5.camel@otta>
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