From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102b75,45b50f14dadfce5b X-Google-Attributes: gid102b75,public X-Google-Thread: 110292,45b50f14dadfce5b X-Google-Attributes: gid110292,public X-Google-Thread: 1164f8,45b50f14dadfce5b X-Google-Attributes: gid1164f8,public From: michael.williams@arm-sponge.com (Michael Williams) Subject: Re: Final kick at the "Merced Guessing Game" Date: 1997/10/14 Message-ID: <61vbv8$nct@sis.cambridge.arm.com>#1/1 X-Deja-AN: 280307415 References: <61g30t$o2n@news-rocq.inria.fr> <61uoiu$19e$1@goanna.cs.rmit.edu.au> X-Address: 90 Fulbourn Road, Cherry Hinton, Cambridge, CB1 4JN, UK X-Note: Remove the word "sponge" from my email address before replying Reply-To: michael.williams@arm-sponge.com X-Disclaimer: This posting does not express the views of Advanced RISC Machines Limited, unless explicitly stated. Organization: Advanced RISC Machines Ltd Newsgroups: comp.sys.intel,comp.arch,comp.sys.dec In article <61uoiu$19e$1@goanna.cs.rmit.edu.au>, Richard A. O'Keefe wrote: >A Fortran compiler is allowed to say "hey, I know the result of 0*F() >without calling F, so I won't call F". A C compiler is not. >Sun's f77 compiler actually does this. I put that example in a file >called 'foo.f' and did f77 -O5 foo.f; a.out The program compiled, >linked, ran, and printed 0. The C version, however, doesn't link, >because it must call f. Actually, gcc probably wouldn't link even if it had optimised out the call to f(), e.g.: if (0) f(); still generates an undefined reference to 'f' in the object file (even though the call to 'f' is optimised out, in this case). Mike. (Learning even more about Fortran every day.)