This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: remove const/pure attribute from builtin gamma/lgamma


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]