This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Revamp fortran array types
Hi,
On Tue, 18 Aug 2009, Tobias Burnus wrote:
> I think this is oversimplified:
>
> "12.5.2.13 Restrictions on entities associated with dummy arguments"
> "Action that affects the value of the entity or any subobject of it
> shall be taken only through the dummy argument unless ... the actual
> argument is a target"
>
> (For pointer it presumably means the target to which the pointer points
> to, i.e. those are covered as well.)
I read that whole section now (similar language already is in the Fortran
95 draft), and it actually explicitely also mentions dummy args with
POINTER attribute:
Action that affects the value of the entity or any
subobject of it shall be taken only through the dummy argument unless
(a) the dummy argument has the POINTER attribute or
(b) the dummy argument has the TARGET attribute, the dummy argument
does not have INTENT(IN), the dummy argument is a scalar object
or an assumed-shape array without the CONTIGUOUS attribute, and
the actual argument is a target other than an array section
with a vector subscript.
Reading all the notes accompanying this rule (especially how they always
exclude pointer/target dummy args), not the least of it this one:
NOTE 12.39
The restrictions on entities associated with dummy arguments are
intended to facilitate a variety of optimizations in the translation
of the subprogram, including implementations of argument association in
which the value of an actual argument that is neither a pointer nor a
target is maintained in a register or in local storage.
makes it realitively clear to me that my example was in fact valid.
Ciao,
Michael.