This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: gcc builtin math vs glibc testsuite
- From: Roger Sayle <roger at eyesopen dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 30 Jun 2003 14:31:14 -0600 (MDT)
- Subject: Re: gcc builtin math vs glibc testsuite
Hi Richard,
> Roger, I think some of your builtin work is causing glibc
> testsuite failures. On alpha-linux I'm seeing
>
> Failure: pow (0, -1) == inf plus division by zero exception:
> Exception "Divide by zero" not set
Thanks for pointing this out. It turns out that the problem is
actually in fold-const.c's const_binop which is evaluating 1.0/0.0
at compile-time even with flag_trapping_math! It looks like there's
already code in const_binop to avoid performing calculations if
either operand is a NaN. However, even this could be improved as
we could can precompute these operations on NaN, if the user specified
-ffast-math, i.e. HONOR_NANS(mode).
I should have a patch bootstrapped and regression tested by the
end of the day. One potential problem to look out for is that we
may be using 1.0/0.0 to generate IEEE Infinity rather than use the
new __builtin_inf.
Sorry for any inconvenience,
Roger
--