Standard experts:
As I was reading the F2x draft I stumbled accross something which I am
pretty sure is the same as in F95 and that is confusing: restrictions
(if any) on dummy procedure arguments with TARGET attribute (12.4.17 in
007R2). The standard says that the values of the entity associated with
a dummy parameter shall only be modified through the dummy argument,
*unless* it is a POINTER or a TARGET+other properties. This in "plain"
words means "ordinary" arguments cannot be aliased (or will be assumed
non-aliased when the compiler translates and optimizes the procedure).
According to this, in the following routine:
subroutine my_routine(a,b)
real, dimension(:), intent(out), TARGET :: a, b
...
a=a+b ! Can a and b safely be assumed non-aliased?!?
end subroutine my_routine
can the compiler optimize well the statement a=a+b (i.e. assume
non-overlap and do not create do any temporary array results or such).
As I am reading 12.4.1.7, it seems the answer is no, but really this
makes no sense. TARGET does imply that the variable may be changed by a
pointer to it. But in no way does it imply that it can be aliased with
another TARGET (non-pointer) variable. So in my limited view a and b
should be assumed non-aliased by the compiler. I may be missing
something or misunderstanding the whole thing though, so please clarify.
Thanks,
Aleksandar
--
__________________________________
Aleksandar Donev
Complex Materials Theory Group (http://cherrypit.princeton.edu/)
Princeton Materials Institute & Program in Applied and Computational
Mathematics
@ Princeton University
Address:
419 Bowen Hall, 70 Prospect Avenue
Princeton University
Princeton, NJ 08540-5211
E-mail: [log in to unmask]
WWW: http://atom.princeton.edu/donev
Phone: (609) 258-2775
Fax: (609) 258-6878
__________________________________
|