Walt Brainerd <[log in to unmask]> wrote:
...
>> Yes, but it doesn't specify how the subroutine is to be executed.
>> Executing an inline copy is perfectly reasonable.
>
>Of course, I agree that inlining is very reasonable. However, if
>we believe that "Interp #1" is correct (I don't), then we must take
>the words from the standard (12.4.3):
>
>"When a subroutine is invoked, ... the subroutine is executed."
>
>It doesn't say that you can extract the executable code out of the
>subroutine and move it into the calling program--just as Interp #1
>says you cannot move code from one statement to another. It says
>you must execute THE SUBROUTINE, not some code extracted from it.
>
>Obviously, this is all silly and Interp #1 should be fixed to put
>things back to the way they have been for 40+ years.
I think we're arguing at cross purposes here. Unless you have a
"Fortran machine" the implementation can't execute THE SUBROUTINE,
but rather a translation of it. The standard says nothing about the nature
of this translation, nor does it say or imply that the translation is only
done once and/or into a single copy.
I don't have a copy of "Interp #1" so I can't comment on whether it
contradicts what I've been saying. I think we agree (in broad terms
at least) what the implementation should be permitted to do. It just
seems obvious (to me) that the standard *shouldn't* say anything about
how the semantics of a conforming program are achieved - only what
those semantics are.
--
J. Giles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|