This is the mail archive of the 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] Structure aliasing analyzer

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.

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