Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!alberta!cpsc.ucalgary.ca!wesson!cliff From: cliff@wesson.phys.ucalgary.ca (Cliff Marcellus) Newsgroups: comp.sys.mips Subject: f77 compiler bug (both MIPS and SGI) Message-ID: <1991Jun17.174155.13484@cpsc.ucalgary.ca> Date: 17 Jun 91 17:41:55 GMT Reply-To: cliff@phys.ucalgary.ca Organization: Institute for Space Research Lines: 41 I've discovered an interesting 'glitch' in the f77 compiler for MIPS (and consequently, for SGI, also). given a code skeleton of : if (...) goto 10 . . . do 10 .... . . . 10 continue From the above, if the 'if' evaluates to TRUE, then the following code, including the DO loop are supposed to be skipped. This doesn't happen under MIPS-fortran. Instead, the loop-code is executed using a value of "whatever" for the control loop variable. Now (personally) I don't see that as a compiler bug, more a case of antequated coding style. (ie. the purpose of the '10 continue' becomes ambigous). Anyway, I thought I would post this in case others are suffering program failures for the same or similiar reason. BTW : the fix to the above is of the form : if (...) goto 11 . . . do 10 .... . . . 10 continue 11 continue ttfn -- Cliff Marcellus | Internet : cliff@phys.ucalgary.ca Department of Physics and Astronomy | SPAN : CANCAL::CLIFF The University of Calgary OPINIONS EXPRESSED WITHIN ARE MY OWN AND NOT THOSE OF THE UNIVERSITY OF CALGARY