Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!xylogics!world!burley From: burley@world.std.com (James C Burley) Newsgroups: comp.lang.fortran Subject: Re: The worst compiler in the whole wide world Message-ID: Date: 19 Jul 90 02:20:33 GMT References: <16430@windy.dsir.govt.nz> <2330.26922b0b@csc.anu.oz> <16521@windy.dsir.govt.nz> <2107@vela.acs.oakland.edu> Sender: burley@world.std.com (James C Burley) Organization: The World Lines: 26 In-Reply-To: khb@chiba.Eng.Sun.COM's message of 18 Jul 90 00:46:19 GMT In article khb@chiba.Eng.Sun.COM (Keith Bierman - SPD Advanced Languages) writes: 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. Apparently the F77 standard (3.9-1978) didn't require DATA'd variables to be treated as having the SAVE attribute also, though it certainly (as you point out) didn't disallow both DATA and SAVE for a variable (i.e. they are not mutually exclusive). But the F90 standard is saying "If you DATA a variable, you implicitly SAVE it (and may explicitly SAVE it also), even though F77 didn't specify this", and it says so in the list of differences at the F77 level between F77 and F90. Presumably the usefulness of having a DATA but not a SAVE attribute for a variable would be that, while the variable has the same storage attributes (i.e. not on the stack) as if it both DATA and SAVE were specified, the lack of a SAVE attribute could allow optimization to decide not to write a new value of the variable back to the memory location from a register before exiting the routine. F90 probably decided the situations in which this might actually be useful were too few and far between to require such a thing of standard-conforming compilers (though I'm putting words in their mouths here!). And/or they discovered that so many programs were written assuming DATA implied SAVE that they should standardize it.