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: Geoff Keating <geoffk at geoffk dot org>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 30 Jun 2003 13:15:23 -0700
- Subject: Re: gcc builtin math vs glibc testsuite
- References: <20030630194120.GD23670@redhat.com>
Richard Henderson <rth@redhat.com> writes:
> 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
> Failure: pow (0, -11) == inf plus division by zero exception:
> Exception "Divide by zero" not set
> Failure: pow (0, -2) == inf plus division by zero exception:
> Exception "Divide by zero" not set
>
> When I look at the generated code for
>
> check_float ("pow (0, -1) == inf plus division by zero exception",
> pow (0, -1), plus_infty, 0, 0, DIVIDE_BY_ZERO_EXCEPTION);
>
> the compiler has hoisted the call to pow elsewhere, which means
> of course that the exception bits are not set as expected.
>
> I think without the equivalent of "#pragma STDC FENV_ACCESS OFF"
> we have to treat a good many of these functions as non-const,
> at least without -ffast-math. I know that we can't even pretend
> proper support for turning FENV_ACCESS ON at present, but this
> case of it not working with an external function is a regression
> from earlier gcc's.
We should have a separate flag for this, like -fno-signaling-nans.
When we implement the #pragma, it will control the initial value of
the pragma.
--
- Geoffrey Keating <geoffk@geoffk.org>