(j3.2006) [MPI3 Fortran] Feedback from Fortran J3 meeting
Wed May 28 13:03:39 EDT 2008
On Wednesday 28 May 2008 09:56, Craig Rasmussen wrote:
> I wonder how C does this? ?What are the rules for code motion in C?
The semantics of the language allow for changes to variables to be made
through pointers to the variables. Such pointers can be saved and remain
valid, so compilers know that changes can happen behind their back. Fortran
only allows such things if the variable has the TARGET attribute, and the
changes are made through a Fortran pointer. With the addition of C Interop,
compilers should assume that calls to C procedures could modify variables
with the TARGET attribute as well. But only during the call, not after the
call completes. This is my interpretation, at least.
More information about the J3