To: J3 09-199 From: John Reid Subject: NOTE 8.31 Date: 2009 April 20 References: J3/09-007r1 Discussion NOTE 8.31 states Apart from the effects of volatile variables, the processor may optimize the execution of a segment as if it were the only image in execution. Unfortunately, this is not quite correct. It must not perform an optimization that might break the rule about definitions and references in unordered segments. For example, consider the code integer (kind=short) x(8)[*] : ! Computation that references and alters x(1:7) : The compiler must not effectively make this replacement integer (kind=short) x(8)[*], temp(8) : temp(1:8) = x(1:8) ! Faster than temp(1:7) = x(1:7) ! Computation that references and alters temp(1:7) x(1:8) = temp(1:8) because another image might reference x(8) in a segment that is unordered with respect to this one. An edit is provided to correct this. Edit to 09-007r1 [190:23+] In 8.5.2, Segments, replace the body of NOTE 8.31 by Because of the restrictions on references and definitions in unordered segments, the processor may apply code motion optimizations within a segment as if it were the only image in execution, provided calls of atomic subroutines are not involved."