vector expression question.
Paul Richard Thomas
paul.richard.thomas@gmail.com
Fri Nov 18 16:06:00 GMT 2011
Hi Tobi,
Good to hear from you!
> Suppose it were valid. Then the standard would be quite explicit:
> e.g. 7.5.1.5 in the Fortran 95 standard:
> "The execution of the assignment shall have the same effect as if the
> evaluation of all operations in expr and variable occurred before any
> portion of variable is defined by the assignment."
>
> Array assignment is equivalent to DO loops with temporaries.
...and a little bit further on:
The processor may perform the element-by-element assignment in any order.
In light of both of these, fortran correctly generates the temporary
for the right hand side ('expr') of the intrinsic assignment. This
temporary is then assigned to the left hand side ('var'). On the
other hand, the do loop must be done in index order, so that each
element is incremented twice.
(Mike, If you compile using gfortran with -fdump-tree-original and
examine the .original file, you will see the coding that generates
the temporary.)
Cheers
Paul
More information about the Fortran
mailing list