On Thu, 21 Nov 2013, N.M. Maclaren wrote:

> On Nov 21 2013, Joseph S. Myers wrote:
> > On Thu, 21 Nov 2013, FX wrote:
> > 
> > > Indeed, 387/SSE has flush-to-zero modes. But other APIs do not (glibc,
> > > SysV, AIX).
> > 
> > Note that glibc libm functions may not work when called in a flush-to-zero
> > mode, only in modes that can be established by the <fenv.h> functions.
> 
> Well, that's two clear bugs :-(
> 
> If, as you say, they may not work at all in combination with -ffast-math,
> that's one.

What does work with -ffast-math is inherently poorly defined - there's a 
general expectation that things work with well-behaved arguments, with a 
requirement that functions not be called with arguments that would result 
in overflow or underflow (or with arguments needing special care to avoid 
internal overflows or underflows, or very large arguments to trig 
functions, for example).

> Setting __STDC_IEC_559__ to 1 in combination with -ffast-math is another,
> given that C99 and C11 reference ISO/IEC 10559 (1989).

Given glibc 2.19 and GCC 4.9 (neither yet released), __STDC_IEC_559__ 
should no longer be defined if -ffast-math, or other options indicating a 
user intent contrary to Annex F, is used.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to