This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: FENV_ACCESS questions in C and Fortran
- To: Geoff Keating <geoffk at ozemail dot com dot au>
- Subject: Re: FENV_ACCESS questions in C and Fortran
- From: Stephen L Moshier <moshier at mediaone dot net>
- Date: Wed, 10 Nov 1999 09:50:14 -0500 (EST)
- cc: gcc at gcc dot gnu dot org
- Reply-To: moshier at mediaone dot net
If you could point out where the standard gives pertinent
information on the code hoisting question, that would be very
helpful. I find statements like the following, that seem to
speak against the behaviors that you were advocating.
Floating-point operations implicitly
set the status flags; modes affect result values of
floating-point operations. Implementations that support
such floating-point state are required to regard changes
to it as side effects -- see annex F for details. The
floating-point environment library <fenv.h> provides a
programming facility for indicating when these side
effects matter, freeing the implementations in other
cases.
[#2] The FENV_ACCESS pragma provides a means to inform the
implementation when a program might access the floating-
point environment to test flags or run under non-default
modes.163)
163The purpose of the FENV_ACCESS pragma is to allow certain
optimizations, for example global common subexpression
elimination, code motion, and constant folding, that
could subvert flag tests and mode changes.