This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, testsuite] Skip case ipa-sra-2.c for strict_align target.


Hi,

On Wed, Sep 07, 2011 at 11:35:53AM +0200, Richard Guenther wrote:
> On Wed, Sep 7, 2011 at 9:47 AM, Terry Guo <terry.guo@arm.com> wrote:
> > Hello,
> >
> > The SRA optimization requires the reference to struct/union member must be
> > aligned to their natural boundary e.g. (int *) must be aligned to 4 byte
> > boundary. This is done in function tree_non_mode_aligned_mem_p. For target
> > like x86 that define "STRICT_ALIGNMENT" to 0, the function return false.
> > Afterward, the SRA is conducted. For target like ARM or MIPS that define
> > "STRICT_ALIGNMENT" to 1, the alignment status is checked by "align =
> > get_object_alignment (exp)". The function get_object_alignment rely on SSA
> > and tend to over-conservative. So for most cases, the SRA is stopped here.
> >
> > This patch intends to skip this case for target that set STRICT_ALIGNMENT to
> > 1 otherwise the case will fail due to the SRA isn't performed actually. OK
> > to commit to trunk?
> 
> Hm, the testcase looks like it should actually pass even for strict-align
> targets.  Martin?
> 

Well, tree_non_mode_aligned_mem_p clearly does not really work very
well and needs a more-or-less reimplementation, there has been a
discussion about this already in August (and you even had a
suggestion):

http://gcc.gnu.org/ml/gcc-patches/2011-08/msg00931.html

This has been only slowly moving towards the top of my TODO list but I
am aware of it and at the moment it is almost there, I should be
looking at this issue pretty soon.

The testcase certainly should pass also on strict alignment
architectures and I'd prefer if it stayed enabled for them.

Martin


> Richard.
> 
> > BR,
> > Terry
> >
> > 2011-09-07 ÂTerry Guo Â<terry.guo@arm.com>
> >
> > Â Â Â Â* gcc.dg/ipa/ipa-sra-2.c: Only run on
> > Â Â Â Âtargets that are non_strict_align.
> >
> >
> > diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c
> > b/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c
> > index 3437a81..c6b4d63 100644
> > --- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c
> > +++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c
> > @@ -1,5 +1,6 @@
> > Â/* { dg-do compile } */
> > Â/* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-details" Â} */
> > +/* { dg-require-effective-target non_strict_align } */
> >
> > Âstruct bovid
> > Â{
> >
> >
> >


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]