This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, testsuite] Skip case ipa-sra-2.c for strict_align target.
- From: Martin Jambor <mjambor at suse dot cz>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: Terry Guo <terry dot guo at arm dot com>, gcc-patches at gcc dot gnu dot org, ro at cebitec dot uni-bielefeld dot de, mikestump at comcast dot net
- Date: Wed, 7 Sep 2011 13:55:22 +0200
- Subject: Re: [Patch, testsuite] Skip case ipa-sra-2.c for strict_align target.
- References: <4e6721bf.ca23440a.52e6.ffffb61dSMTPIN_ADDED@mx.google.com> <CAFiYyc3eSk7Ku4SN5uBMWU+ubRPKpd370xn6k--mKYqjUMY0PQ@mail.gmail.com>
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
> > Â{
> >
> >
> >