Path: utzoo!attcan!uunet!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!wuarchive!texbell!texsun!newstop!sun!khb From: khb@chiba.Eng.Sun.COM (Keith Bierman - SPD Advanced Languages) Newsgroups: comp.lang.fortran Subject: Re: The worst compiler in the whole wide world Message-ID: Date: 18 Jul 90 00:46:19 GMT References: <16430@windy.dsir.govt.nz> <2330.26922b0b@csc.anu.oz> <16521@windy.dsir.govt.nz> <2107@vela.acs.oakland.edu> Sender: news@sun.Eng.Sun.COM Organization: Sun MegaSystems Lines: 49 In-reply-to: bbesler@vela.acs.oakland.edu's message of 17 Jul 90 23:00:06 GMT In article <2107@vela.acs.oakland.edu> bbesler@vela.acs.oakland.edu (Brent Besler) writes: ... 5820 and the SG machines many code will mysteriously start working if you compile them with the -static option. For this class of codes, nothing mysterious, at least not in most cases. X3.9-1978 allows local storage to be just that. Local. Not saved from call to call. Thus one _can_ get it from the stack, or a heap or whatever. But many codes expect: 1) unitialized variables to be zero 2) values to be preserved across calls Many will dispute #2, especially on their own codes .... but it does happen. A popular (in some circles) matrix output routine I once inherited control of, exhibited both! .... lots of stuff M=MOLD ..... MOLD=M First time through it was zero (by magic). After that, it correctly "remembered" the column number from the last run. Which was what was desired. This was only discovered after a port to a high performance box.... The way to write standard compliant code which does this is integer MOLD ! well OK, I'm using mixed case ;> and ! data MOLD/0/ save MOLD M=MOLD ... etc. Interestingly enough, some compilers seem to think that save and data are mutually exclusive. I have never found text in 3.9-1978 to justify that ... compilers that can't accept both, do tend to treat DATA variables as saved so the functionality is present. -- Keith H. Bierman |*My thoughts are my own. !! kbierman@Eng.Sun.COM It's Not My Fault | MTS --Only my work belongs to Sun* khb@chiba.Eng.Sun.COM I Voted for Bill & | Advanced Languages/Floating Point Group (415 336 2648) Opus "When the going gets Weird .. the Weird turn PRO"