Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!nntpd.lkg.dec.com!tkou02.enet.dec.com!jit533!diamond From: diamond@jit533.swstokyo.dec.com (Norman Diamond) Newsgroups: comp.sys.mips Subject: Re: f77 compiler bug (both MIPS and SGI) Message-ID: <1991Jun21.035714.20394@tkou02.enet.dec.com> Date: 21 Jun 91 03:57:14 GMT References: <1991Jun19.162129.2870@batcomputer.tn.cornell.edu> <1991Jun17.224729.15190@rice.edu> <1991Jun18.191622.4008@odin.corp.sgi.com> <1991Jun19.133207.24629@cpsc.ucalgary.ca> <1991Jun20.075058.10576@groucho> Sender: usenet@tkou02.enet.dec.com (USENET News System) Reply-To: diamond@jit533.enet@tkou02.enet.dec.com (Norman Diamond) Organization: Digital Equipment Corporation Japan , Tokyo Lines: 64 In article <1991Jun20.075058.10576@groucho> pbickers@tamaluit.phys.uidaho.edu (Paul Bickerstaff) writes: >>>>> if (...) goto 10 >>>>> . >>>>> do 10 .... >>>>> . >>>>>10 continue >The Mips compiler has a lot of useful flags for those who believe >fortran is defined by past usage By past usage, eh? In Fortran-66, DO loops could have extended ranges. It was REQUIRED for the do-loop in the quoted example to be executed after the goto (unless incrementing the index puts it over the upper bound in the do statement, in which case the loop exits). So this seems to be a complaint that the compiler conforms to too many past usages, eh? >and not some self-appointed expert from ansi Well, a few experts are appointed by their employers, but otherwise, yes the experts are self-appointed. ANSI is not the military and does not conscript involuntary members. You should appoint yourself and get several of your friends to appoint themselves, and join the ANSI committee. One voice can make a difference, but several are more powerful. >1) Very similar, if not identical, to the one above. We had a visitor >from Germany whose program ran on a Vax, an IBM and a Convex >(and probably a Cray) but our Mips spewed garbage. The problem >was traced to a construct like > do 10 ... > ... > if (...) goto 10 > do 10 ... > ... > 10 continue >The use of a single continue as the last statement in overlapping do >loops is apparently allowed -- the Mips fortran manual says so -- Yes, the last statement is in the range of both do-loops. >but as above the goto failed. Yes, because the goto is not in the range of the second do-loop, and the continue IS in the range of the second do-loop. >(I may not have recalled the exact >construction but there was no compiler error, just wrong results.) You mean right results. The program got what it asked for. >Using two distinct continue statements cured this guy's problem. Yes, when the programmer asked for what he wanted, instead of asking for something different, it worked wonders. >Not hard to fix you may say but a waste of much time surely. If learning to program is a waste of time, it sounds like you're in the wrong profession. -- Norman Diamond diamond@tkov50.enet.dec.com If this were the company's opinion, I wouldn't be allowed to post it. Permission is granted to feel this signature, but not to look at it.