Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!hc!lanl!jlg From: jlg@lanl.gov (Jim Giles) Newsgroups: comp.lang.fortran Subject: Re: NEW TOPIC: Consistency of execution environment Message-ID: <3643@lanl.gov> Date: 15 Sep 88 22:38:45 GMT References: <995@amelia.nas.nasa.gov> Organization: Los Alamos National Laboratory Lines: 33 From article <995@amelia.nas.nasa.gov>, by fouts@lemming.nas.nasa.gov.nas.nasa.gov (Marty Fouts): > > DO 10 I = 1, 100 > J = I > C > C other things which prevent assuming that J is an alias > C > 10 CONTINUE > > I know that Fortran isn't required to keep a memory consistent version > of I around, but is it true that some part of the standard can be > interpretted as requiring that the value of J in memory be updated for The Fortran standard doesn't require _anything_ of memory. The standard describes what constitutes a standard conforming program and what semantics a standard conforming processor must provide. If all the uses of I and J are local enough for the compiler to identify them, the compiler is free to put them both in registers and not allocate any memory at all for them. In fact, if I and J are always identical (as above) the compiler is free to use only one register for both of them CFT77 on the crays will probably not even allocate memory for I and J if they are only used in the loop and arent passed as arguments to any subroutines. CFT on the Cray _may_ have more of a problem with these (CFT _always_ allocates memory for variables even if it's not necessary). Unfortunately CFT often vectorizes better than CFT77 does (although this is getting better). Neither CFT nor CFT77 should generate stores for I and J _within_ the loop unless they are passed to some procedure call (either as arguments or through common - if J is in a common block and the loop makes _any_ procedure calls, J will be stored). J. Giles