Path: utzoo!attcan!uunet!lll-winken!ames!hc!lanl!jlg From: jlg@lanl.gov (Jim Giles) Newsgroups: comp.lang.fortran Subject: Re: DO loops, anyone? Message-ID: <10623@lanl.gov> Date: 17 Mar 89 23:35:34 GMT References: <1913@devsys.oakhill.UUCP> Organization: Los Alamos National Laboratory Lines: 36 From article <1913@devsys.oakhill.UUCP>, by steve@oakhill.UUCP (steve): > [...] > Unfortunately you can't save the unwashed masses from themselves. > Not only can you not prevent them from doing this. If you forbid > it, they cry and want it. If you want to sell compilers, this is > something that must be supported. do 10 i=1,10 print *,i if (i.gt.5) goto 10 do 10 j=1,5 print *,j 10 continue This program infinite loops on the Cray with CFT 1.14. If this is the behaviour that "must be supported" to sell compilers, I don't want any part of it. I consider this to be an _ERROR_ in the compiler and I'm reporting it to Cray as such. To be fair, the CFT compiler does issue a warning that the branch is illegal. If a compiler wants to allow the above program it should at least compile it to something useful. The only "meaningful" interpretation of the above I can think of is equivalent to the following: do 10a i=1,10 print *,i if (i.gt.5) goto 10a do 10 j=1,5 print *,j 10 continue 10a continue If a compiler doesn't issue a FATAL message, it should give the above interpretation - nothing else is acceptable. (Note, I used '10a' as the label in the above example to make it clear that it is a compiler generated label.)