Richard Maine <nos...@see.signature> wrote:
> Lynn McGuire <
l...@winsim.com> wrote:
>> Fortran 66 and before could jump anywhere, including
>> control structures but fortran 77 put a stop to that
>> nasty practice.
(snip on Extended range of the DO)
> Whether compilers would catch the error would be a different
> question. I recall on occasion fixing code where someone had
> invalidly jumped into a DO loop in ways that did not have
> anything to do with the extended range of a DO.
The need to support Extended range of the DO likely restricts
some optimizations that compilers might otherwise make, and
that would cause problems. It also makes it harder for
compilers to test for the illegal cases.
> Sometimes the code even happened to work the way that was
> intended when run on the compiler it was developed on, but
> that was more a matter of particular compiler behavior than
> of being part of the language.
One I remember from many years ago was an FFT routine that
used nested DO loops to do the bit-reversed path through
the arrays. They put in enough DO loops for the largest
case needed, a GOTO into the appropriate loop, and GOTO out
before the end of the loop. The latter being important
in many cases. (Though no less illegal.)
> Other times, the code was just plain broken, but testing (if
> any at all beyond the level of "it ran and printed results":-()
> had not uncovered the error.
-- glen