On Sat, 3 Jan 2009, Toon Moene wrote:

> Richard Guenther wrote:
> 
> > On Sat, 3 Jan 2009, Toon Moene wrote:
> 
> > > The pointers used by the Fortran Front End to implement Fortran's argument
> > > association *cannot* point to anything else than the storage of those
> > > arguments, because they (those pointers) are generated by the compiler and
> > > cannot point to anything else (they cannot be modified).
> > 
> > Ok.  I guess that would answer my request from earlier last year as if
> > that includes reachable memory - not.
> 
> I am sorry about that.  The number of unread mails in my inbox from last year
> is 13635.
> 
> > The issue is with fortran
> > array passing which is (simplified) done from a middle-end point of view
> > as
> > 
> >  struct { void *data; } array1, array2;
> >  array1.data = xyz;
> >  array2.data = wur;
> >  foo (&array1, &array2);
> > 
> > so - if the argument to foo aliases with nothing that doesn't help
> > optimization.  We know that array1->data and arrray2->data do
> > not alias - but we do _not_ know that *array1->data (*xyz) and
> > *array2->data (*wur) do not alias - unless that "aliases nothing"
> > extends to everything reachable from the arguments.
> 
> The point is that *inside foo* the compiler is free to assume two array
> arguments cannot overlap.  If, outside foo, they do, that's a programmer's
> error.

But the current specification does not help foo seeing that.  Foo only
sees that the array descriptors do not alias, it doesn't see that
the actual array data does not alias.

> > I btw installed that (wrong?) patch based on the answers I got.
> 
> My apologies - see above.

At least the wrong patch makes foo see that the array data does not alias.

Maybe we need to fix the specification?

Richard.

Reply via email to