J3/09-109 To: J3 From: Van Snyder Subject: Editorial stuff concerning "transfer of control" Date: 2009 January 13 References: 09-007, 08-206 1. Introduction 2.3.5 is poorly structured. It ought to specify the normal execution sequence first, then the exceptions. Rather, it specifies one exception, then the normal sequence, then some more exceptions. 2.3.5 doesn't explain how execution proceeds when execution of a procedure completes. RETURN [315: 12.6.2.7p1] just says it completes execution of a procedure (in the case an alternative return is not taken, which is explained by reference to branching). END is defined in terms of RETURN. FORALL and WHERE constructs are not mentioned in 2.3.5. We can't just add them to the second list item because they do not have "implicit internal branching". DO CONCURRENT is not properly treated in 2.3.5; it isn't really like other DO constructs in that it does not have "implicit internal branching". The term "transfer of control" is not defined. There is an partial suggestion of its meaning where 8.2p1 specifies that it is the result of a branch. 8.2p1 says that procedure references and control structures also cause transfer of control, but the term is used in several places where this is clearly not desired. Subclause 2.3.5 specifies the execution sequence. The term "change the normal execution sequence", with reference to 2.3.5, should be used instead. Assuming the term "transfer of control" means "change the normal execution sequence," it is almost always used incorrectly; it usually ought to be "branch". The predecessor of this paper, 08-206, was rejected at meeting 185 with the comment "new feature." This paper definitely does not describe a new feature; it is a correction of an incomplete and erroneous description. 2. Edits w.r.t. 08-007r2. [4:22+ 1.3.11+] -------------------------------------------------------- Editor: Insert a subclause: "1.3.11a branch change the normal sequence of execution (8.2)" [12:11+ 1.3.82+] ------------------------------------------------------- Editor: Insert a subclause: "1.3.82a Normal execution sequence execution of executable constructs in the order in which they appear (2.4.5)" [31:12-15 2.3.5p1] ----------------------------------------------------- Editor: Delete "When ... point." It will reappear later. [31:15 2.3.5p1] -------------------------------------------------------- Editor: Replace "effect of execution" by "effect of the <>". {Define the term "normal execution sequence", which will be used in 8.2.1.} [31:16 2.3.5p1] -------------------------------------------------------- Editor: Insert "within a scoping unit" before "are executed in the order". [31:18-19 2.3.5p1] ----------------------------------------------------- Editor: Replace the first list item by: "o When a procedure is invoked, the specification expressions within the of the invoked procedure, if any, are evaluated in a processor dependent order. Thereafter, the execution sequence proceeds to the first executable construct appearing within the scoping unit of the procedure after the invoked entry point. "o When execution of a subroutine invoked by execution of a CALL statement completes, execution of the CALL statement that invoked the subroutine completes. When execution of a function completes, evaluation of the expression in which it was invoked either continues or completes. When execution of a final subroutine or a user-defined input/output subroutine that was invoked as part of another process completes, that process either continues or completes. "o Branching (8.2, 9.11.3, 9.11.4, 12.6.2.7) changes the execution sequence by explicitly specifying a new starting place, within the same scoping unit as the branch, for the execution sequence." [31:20 2.3.5p1] -------------------------------------------------------- Editor: After "DO constructs" in the second list item, insert "other than DO CONCURRENT constructs" or "that are not DO CONCURRENT constructs". [31:22+ 2.3.5p1] ------------------------------------------------------- Editor: Insert list items after the second one: "o A DO CONCURRENT construct (8.1.7) cases a to be executed a specified number of times. During execution of the the sequence of execution proceeds as specified in this subclause, but the order of execution of the s is not specified." "o A WHERE construct (7.2.3) causes s to be executed. During execution of a the sequence of execution proceeds as specified in this subclause, but the order of execution of the s is not specified." "o A FORALL construct (7.2.4) causes a to be executed a specified number of times. During execution of the the sequence of execution proceeds as specified in this subclause, but the order of execution of the s is not specified." [52:16+8 4.4.3: NOTE 4.8] ---------------------------------------------- Editor: Replace "transfer of control" by "branch (8.2)". [131:22 6.6.3.2p2] ----------------------------------------------------- Editor: Replace "When ... statement" by "When a RETURN or END statement is executed". {We don't want the executable constructs after the point of execution of the procedure to start executing until after the allocatable variables are deallocated.} [171:20 8.1.2.1p1] ----------------------------------------------------- Editor: Replace "Transfer of control" by "Branching (8.2)" to remove any possibility that "transfer of control" might be interpreted as a procedure reference. 8.2.1 explicitly says that there are transfers of control that are not branches. The two occurrences of "transfers" in this paragraph are correct. [171:22 8.1.2.1p2] ----------------------------------------------------- Editor: Delete 8.1.2.1p2 because it is repetitive of 2.3.5. [179:22-24 8.1.7.4p1] -------------------------------------------------- Editor: Replace the paragraph by "The <> of a block DO construct is the ." The remainder of the paragraph is repetitive of 8.1.2.1p1. At least replace "transfer of control" by "branching (8.2)". [179:27 8.1.7.4p2] ----------------------------------------------------- Editor: Replace "transfer of control" by "branching (8.2)". [179:35 8.1.7.6.1p1] --------------------------------------------------- Editor: After "DO statement" insert "other than a DO CONCURRENT statement" or "that is not a DO CONCURRENT statement". [181:6-8 8.1.7.6.3p5] -------------------------------------------------- Editor: Replace the first "transfer of control" by "branch (8.2)" the second by "branching", and the third by "branch". [188:3-4 8.2.1p1] ------------------------------------------------------ Editor: Replace the first two sentences to use the definition of execution sequence in 2.4.5: "<> alters the normal execution sequence (2.4.5). When a branch occurs, the next statement executed is the branch target statement, in the same scoping unit, that is labeled by the label in the branch, instead of the one that would be executed by continuing the normal execution sequence." [188:7 8.2.1p1] -------------------------------------------------------- Editor: Replace "cause transfer of control" by "change the normal execution sequence". [188:16-17 8.2.2p1] ---------------------------------------------------- Editor: Replace the paragraph by: "Execution of a <> causes a branch to the branch target statement identified by the label." {Use the definitions of "branch" and "branch target statement" in 8.2.1.} [188:23 8.2.3p1] ------------------------------------------------------- Editor: Replace "a transfer of control ... is the one" by "a branch occurs to the branch target statement" {Use the definitions of "branch" and "branch target statement" in 8.2.1.} [188:31-32 8.2.4p1] ---------------------------------------------------- Editor: Replace "transfer of control" by "branch". Insert "is the one" before "identified". Replace "is executed next" by a comma. The result is "The branch target statement is the one identified by the first label, the second label, or the third label, depending on...." {Use the definitions of "branch" and "branch target statement" in 8.2.1.} [315:29:31 12.6.2.7p1] ------------------------------------------------- Editor: Replace "transfers control to the" by "branches (8.2) to the branch target". Replace "transfer of control" by "branch". {Use the definitions of "branch" and "branch target statement" in 8.2.1.} [600] ------------------------------------------------------------------ Editor: Replace the index items "transfer of control" by "branch", especially the ones on pp 243-244, because they actually use the term "branch". Add an index item for "branch" in 12.6.2.7p1.