| Toon Moene 2004-06-25, 7:43 pm |
| James Giles wrote:
> I think that's a profound misinterpretation of the concept of
> "as-if". Execution is the ultimate authority on the semantic
> meaning of the program.
Depends on your definition of "execution" (and what the meaning of "is"
is - sorry, couldn't resist :-)
Given the following Fortran program:
LOGICAL FUNCTION WHATIF()
WHATIF = .FALSE.
END
PROGRAM PROG
LOGICAL WHATIF
IF (WHATIF()) THEN
PRINT*, 'WHOAH'
ELSE
PRINT*, 'YEAH, RIGHT'
ENDIF
END
and compiling with g77 -O2 -finline-functions -S, the resulting
assembler file shows that the compiler completely elided the
IF (WHATIF()) THEN
PRINT*, 'WHOAH'
ELSE
ENDIF
part and only retained the
PRINT*, 'YEAH, RIGHT'
part.
Now, depending on your definition of "execute", this might mean that the
"processor" didn't "execute" the function.
Hope this helps,
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/
|