Patchwork [4.7] Backport fix for PR tree-optimization/53708

login
register
mail settings
Submitter Peter Bergner
Date Nov. 1, 2012, 2:54 a.m.
Message ID <1351738449.4619.10.camel@otta>
Download mbox | patch
Permalink /patch/196073/
State New
Headers show

Comments

Peter Bergner - Nov. 1, 2012, 2:54 a.m.
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.
Peter Bergner - Nov. 3, 2012, 2:48 p.m.
On Wed, 2012-10-31 at 21:54 -0500, Peter Bergner wrote:
> 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.

Committed to the 4.7 branch now too as revision 193121.

Peter

Patch

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