This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: IEEE inexact-flag not working on the Alpha (despite -mieee-with-inexact)?
Andreas Schwab wrote:
Roberto Bagnara <bagnara@cs.unipr.it> writes:
thanks for your message. Do you mean that we need to enable the FENV_ACCESS
pragma to get defined behavior only on the Alpha or also elsewhere?
See the C standard, 7.6.1 The FENV_ACCESS pragma.
The FENV_ACCESS pragma provides a means to inform the implementation
when a program might access the ïoating-point environment to test
ïoating-point status ïags or run under non-default ïoating-point
control modes. ... If part of a program tests ïoating-point status
ïags, sets ïoating-point control modes, or runs under non-default mode
settings, but was translated with the state for the FENV_ACCESS pragma
ââoffââ, the behavior is undeïned.
I did read that, but I thought that, from a practical (i.e., not legal)
standpoint, the issues were constant-propagation and other similar
transformations, that is, something that seems unrelated to our testcase.
Sorry if I insist, and thank you in advance for clarifying.
Do you mean both the following?
1) Any program calling fetestexcept() without setting FENV_ACCESS "on"
has undefined behavior, not only as far as the standard is concerned,
but also in the GCC concrete world (meaning that GCC may really do no
matter what if fetestexcept() is invoked with FENV_ACCESS "off").
2) GCC does not implement a way to set FENV_ACCESS "on" so that
fetestexcept() can be used reliably.
I guess I misunderstood you either on point 1 or on point 2 or on both,
because otherwise we would have that any program compiled with GCC
and calling fetestexcept() has (in concrete terms) undefined behavior.
All the best,
Roberto
--
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara@cs.unipr.it