This is the mail archive of the
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.email@example.com>
On Tue, 31 Oct 2006, Roger Sayle wrote:
> On Tue, 31 Oct 2006, Kaveh R. GHAZI wrote:
> > 2006-10-30 Kaveh R. Ghazi <firstname.lastname@example.org>
> > * 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! :-)
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
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.
Kaveh R. Ghazi email@example.com