On Mon, 22 Mar 2004, Aleksandar Donev wrote:
> Renchi Raju wrote:
> > i'm still not very convinced that pointers to sub-arrays or strided arrays
> > should have been allowed in the first place.
> Why should one disallow something just because it can be misused??? There are
> many things that should be forbidden if this is a design philosophy. The
> error in F95 IMO is that it did not introduce restricted kinds of array
> pointers, so that compilers need to assume the worst case. But certainly
> pointers to subarrays are useful (think of a pointer to a row of a 2D array),
> just like any other strided array.
thats exactly my point, since the compiler has no way of distinguishing
between pointers to contiguous and strided data, it will have a really
tough time optimizing for it and in most cases will pick the worst case
scenario.
renchi
|