One more little difference between an ALLOCATABLE array *without* the
TARGET attribute and a POINTER: aliasing. It's possible for a pointer
but can't happen to such an array. Thus one more possible (tiny)
optimization.
This is not tiny, it's major. If the derived type appears in a modul for
example, then the whole thing becomes global, and the compiler must assume
that any two pointers might alias together. In that case, a simple thing
like A = B + C must be turned into temp = B + C; A = temp. This is the
single most important reason that in all the compilers I know of, Pointers
are slower than allocatables.
--
Richard Shapiro
Principal Engineer, Silicon Graphics SSO
[log in to unmask]
(781) 648-2269 MRF, (978) 567-2211 TW, (978) 567-2411 (Fax)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|