This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Structure aliasing analyzer
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Steve Ellcey <sje at cup dot hp dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 13 May 2005 16:59:50 -0400
- Subject: Re: [PATCH] Structure aliasing analyzer
- References: <200505131557.IAA02575@hpsje.cup.hp.com>
On Fri, 2005-05-13 at 08:57 -0700, Steve Ellcey wrote:
> > This patch adds the structure alias analyzer to GCC.
> >
> > --Dan
>
> Dan,
>
> I applied this patch to my source tree and tested PR
> tree-optimization/20643. It didn't have any affect on the generated
> code. I don't know if that is to be expected or not.
I'm doing this in stages.
The analyzer alone is only currently used to disambiguate what the
current points to thinks points to anything.
Then i will replace the existing analyzer with the new one, which will
give us some more gain.
However, disambiguating between two random incoming structure accesses
is going to require some more infrastructure work that i am in the
process of finishing for submission.
So things like
int foo(struct foo *a)
{
a->b = 5;
a->c = 6;
}
will not be disambiguated yet.
We need to name dereference sites differently in order to do that, which
is the infrastructure i am working on
One thing at a time.
Hopefully by the end of Stage 2 we will be able to disambiguate that.
I should also note that the following would not be optimized:
int foo(struct foo *a, int *i)
{
a->b =5
*i = 6;
foo = a->b;
}
At least until we have kenny's analysis in and can thus tell when
nothing has taken the address of the field a->b is accessing. Otherwise,
int *i could be a pointer to the field.