http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54932

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-10-16 
19:26:30 UTC ---
(In reply to comment #1)
> If Fortran requires i to be HUGE(i) + 1 after the loop body then what does
> it say about the overflow?

Interesting question.


The Fortran standard just states (F2008):

"8.1.6.6.4 Loop termination"

"For a DO construct that is not a DO CONCURRENT construct, the loop terminates,
and the DO construct becomes inactive, when any of the following occurs.
[...]
"* The iteration count is determined to be zero or the scalar-logical-expr is
false, when tested during step (1) of the above execution cycle."
[...]
"When a DO construct becomes inactive, the DO variable, if any, of the DO
construct retains its last defined value."


where (1) is the first step of the iteration (8.1.6.6.2 The execution cycle):

 "(1) The iteration count, if any, is tested. If it is zero, the loop
terminates and the DO construct becomes inactive. [...]
 "(2) The range of the loop is executed.
 "(3) The iteration count, if any, is decremented by one. The DO variable, if
any, is incremented by the value of the incrementation parameter m3."



Additionally, the standard specifies:

"7.1.5.2.4 Evaluation of numeric intrinsic operations"
"The execution of any numeric operation whose result is not defined by the
arithmetic used by the processor is prohibited."

Reply via email to