Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site intelca.UUCP Path: utzoo!utcsrgv!garfield!philabs!cmcl2!seismo!hao!hplabs!intelca!cem From: cem@intelca.UUCP (Chuck McManis) Newsgroups: net.unix-wizards,net.lang Subject: Re: smart compilers Message-ID: <472@intelca.UUCP> Date: Fri, 4-Jan-85 15:23:18 EST Article-I.D.: intelca.472 Posted: Fri Jan 4 15:23:18 1985 Date-Received: Sat, 5-Jan-85 22:42:26 EST References: <6599@brl-tgr.ARPA> <979@opus.UUCP> <1146@ut-ngp.UUCP> <18397@lanl.ARPA> Organization: Intel, Santa Clara, Ca. Lines: 28 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. :-}