On Tue, 12 Sep 2017, Wilco Dijkstra wrote:

> * Make -fno-math-errno the default - this mostly affects the code generated 
> for
>   sqrt, which should be treated just like floating point division and not set
>   errno by default (unless you explicitly select C89 mode).
> 
> * Make -fno-trapping-math the default - another obvious one. From the docs:

Note these would both have implications for library math_errhandling 
settings (since the compiler options can affect built-in functions).  In 
the absence of -ffast-math glibc defines it to (MATH_ERRNO | 
MATH_ERREXCEPT).  __NO_MATH_ERRNO__ exists since GCC 5 to allow it to be 
defined to just MATH_ERREXCEPT in the -fno-math-errno case, but the header 
needs updating to respect that.  And we don't have a macro for 
-fno-trapping-math to say whether MATH_ERREXCEPT should be part of the 
value.

My assumption is that with changed defaults glibc would need to compile 
with -ftrapping-math just as it uses -frounding-math; code may expect 
transformations that add exceptions not to occur.  It probably does not 
require -fmath-errno (glibc functions do not generally rely on other 
functions setting errno).

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

Reply via email to