This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: remove const/pure attribute from builtin gamma/lgamma
- From: "Kaveh R. GHAZI" <ghazi at caip dot rutgers dot edu>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 2 Nov 2006 09:29:14 -0500 (EST)
- Subject: Re: PATCH: remove const/pure attribute from builtin gamma/lgamma
- References: <Pine.LNX.4.44.0610311752390.898-100000@www.eyesopen.com>
On Tue, 31 Oct 2006, Roger Sayle wrote:
> On Tue, 31 Oct 2006, Kaveh R. GHAZI wrote:
> > 2006-10-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
> >
> > * builtins.def (gamma, lgamma): Use ATTR_MATHFN_FPROUNDING_STORE.
> >
> > testsuite:
> > * gcc.dg/torture/builtin-attr-1.c: Don't test gamma/lgamma.
> > * gcc.dg/torture/builtin-convert-1.c: Don't test lgamma.
>
> This is OK for all branches. Thanks.
>
> Who on earth comes up with these APIs?! Does this mess things up for
> compile-time evalution, or do we need a -fno-signgam-math option! :-)
> Roger
I agree the C99 API is lame :-), it's also not thread safe. For
compile-time evaluation, I might be able to wrap a compound expression
like I did for sincos. E.g lgamma(foo) -> (signgam = bar, baz) where
"bar" is the sign value and "baz" is the lgamma result.
However there is a more serious problem with mpfr_lngamma, in that it does
not exactly correspond to c99's lgamma. See
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29335#c16
I'm trying to get the MPFR folks to resolve this. I am optimistic that a
solution will be implemented, but whether it's in the next micro or major
MPFR release may depend on which solution is chosen.
http://sympa.loria.fr/wwsympa/arc/mpfr/2006-10/msg00036.html
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu