Aleksander,
I think that you are misreading the standard. Lets look at this example:
subroutine sub(a,b,c)
real, dimension(:), target:: a,b,c
real, dimension(:), pointer:: p
integer:: i
a = b + c
p => b
p(4)=3.14
end
I read the standard such that:
a, b and c can not be aliased to each other. That is, the assignment can
be rewritten by the compiler as:
do i=1,N
a(i)=b(i)+c(i)
end do
It is illegal to call the subroutine by e.g. call sub(x(3:22),x(1:20),x(2:21))
which would break tha non-aliasing of the dummy arguments.
However b is aliased in the sense that there can be a pointer associated
to it. The value of b(4) is modified through the use of a pointer. This is
a very important distinction. TARGET attributes have relatively little
effect in performance, it is only a TARGET attributed variable in a context
where a POINTER is also involved that the compiler needs to be cautious.
I think that the wording in the standard tries to state the "obvious" fact
that a TARGET variable can be modified through the variable or through the
use of a POINTER associated with the variable. It is not trying to relax
the restriction on the _actual_ arguments used in calling the subroutine.
But, I am not a standards expert. Maybe someone can comment that knows more
than I?
/Nils
|