Re: Need Help: compiling old Fortran program



In article <1183440526.358369.52110@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Terence <tbwright@xxxxxxxxx> wrote:
I was surprised nobody mentioned the effects of changing the value of
the DO-loop varable within the range of the loop. In the history of
compilers, there are (were) two ways of controlling a do-loop, DO
(label) I=i1,i2,i3

1) initialising the index to i1-i3 before the looping part,
incrementing by i3 and testing the current value against the i2 limit
before executing the loop instructions;

What is supposed to happen in that case if none of i1,i2,i3
overflows but i1-i3 does?

-- John Harper, School of Mathematics, Statistics and Computer Science,
Victoria University, PO Box 600, Wellington 6140, New Zealand
e-mail john.harper@xxxxxxxxx phone (+64)(4)463 5341 fax (+64)(4)463 5045
.



Relevant Pages

  • Re: Need Help: compiling old Fortran program
    ... the DO-loop varable within the range of the loop. ... In the history of ... compilers, there are two ways of controlling a do-loop, DO ...
    (comp.lang.fortran)
  • Re: MATMUL slower than expected
    ... a couple of the compilers are faster running explicit loops than using MATMUL. ... double loop with dot_product: 11.52825 ...
    (comp.lang.fortran)
  • Re: Duffs Device
    ... I'd disagree a little on the above assessment that even in C unless you were looking at a very low-level case similar to what Glen was talking about would the optimizer not likely make such improvements as were appropriate for the specific hardware platform/compiler implementation if one simply wrote the "straightahead" loop. ... If, of course, there's a lot of indirection and all inside, that could limit optimization but for the simple case don't think it would help much for most modern compilers. ...
    (comp.lang.fortran)
  • Re: Likely/Unlikely and standards
    ... Some will say this subject should be left entirely to forums dedicated to particular compilers or platforms, but there are a few generalizations. ... Default optimization for conditional branch not taken is a de facto standard. ... There should be no performance penalty for the use of a break, except that it is preferable to use an ifblock rather than break, in the case where the last part of a loop body is to be skipped on the last loop iteration. ... I have waged a several year campaign against compilers requiring break to be placed in an else block to enable optimization. ...
    (comp.lang.c)
  • Re: Likely/Unlikely and standards
    ... general" case e.g remain standard compliant and platform independant? ... to particular compilers or platforms, but there are a few generalizations. ... there is a conditional loop exit, the branch which leads to continued ... more compact code. ...
    (comp.lang.c)