smart compilers

Chuck McManis cem at intelca.UUCP
Sat Jan 5 06:23:18 AEST 1985


Again on the subject of "smart" compilers, specifically FORTRAN-IV on a DEC
2060XE running TOPS-20. The following code segment is approximate but the 
situation was the same. 

	CALL FOO(X,0.,Z)
	...
	X2 = 0.
	WRITE(5,10) X2
10	FORMAT(1X,F10.2)
	END
	SUBROUTINE FOO(X,Y,Z)
	...
	Y=1.0
	RETURN
	END
Where the compiler optimized all constant references to 0.0 to a memory
location containing 0.0 and the subroutine changed that value to 1.0. All
further references to 0 produced the value 1. Not to swift. (I know it is 
poor style, and have since stopped using constants in subroutine calls.)

--Chuck
 

-- 
                                            - - - D I S C L A I M E R - - - 
{ihnp4,fortune}!dual\                     All opinions expressed herein are my
        {qantel,idi}-> !intelca!cem       own and not those of my employer, my
 {ucbvax,hao}!hplabs/                     friends, or my avocado plant. :-}



More information about the Comp.unix.wizards mailing list