Patchwork [PR,49094] Refrain from creating misaligned accesses in SRA

login
register
mail settings
Submitter Martin Jambor
Date July 1, 2011, 3:55 p.m.
Message ID <20110701155526.GB303@virgil.arch.suse.de>
Download mbox | patch
Permalink /patch/102924/
State New
Headers show

Comments

Martin Jambor - July 1, 2011, 3:55 p.m.
Hi,

On Thu, Jun 30, 2011 at 06:36:01PM +0200, Martin Jambor wrote:
> Hi,
> 
> On Thu, Jun 30, 2011 at 03:39:55PM +0200, Martin Jambor wrote:
> > Hi,
> > 
> > I had to add a test that the analyzed expression is not an SSA name.
> > This has been approved by Rchi on IRC yesterday.  Thus, I have
> > committed the following as revision 175703 after successful run of c
> > and c++ testsuite on sparc64 (and a bootstrap and test with another
> > patch on x86_64-linux).
> 
> I also tested fortran on sparc64 but missed a regression there
> (gfortran.dg/pr25923.f90).  The problem is that *arg_1(D) is also
> scrutinized, get_object_alignment returns 8 for it and that is
> obviously not enough for SImode required alignment.
> 

The following patch resolves this issue, has been approved on IRC by
Richi and I have just committed it.

Thanks,

Martin


2011-07-01  Martin Jambor  <mjambor@suse.cz>

	* tree-sra.c (tree_non_mode_aligned_mem_p): Also ignore MEM_REFs.

Patch

Index: src/gcc/tree-sra.c
===================================================================
--- src.orig/gcc/tree-sra.c
+++ src/gcc/tree-sra.c
@@ -1076,6 +1076,7 @@  tree_non_mode_aligned_mem_p (tree exp)
   unsigned int align;
 
   if (TREE_CODE (exp) == SSA_NAME
+      || TREE_CODE (exp) == MEM_REF
       || mode == BLKmode
       || !STRICT_ALIGNMENT)
     return false;