Bug 30250 - Evaluate lgamma/gamma at compile-time
Evaluate lgamma/gamma at compile-time
Status: ASSIGNED
Product: gcc
Classification: Unclassified
Component: middle-end
4.3.0
: P3 enhancement
: ---
Assigned To: Kaveh Ghazi
: missed-optimization
Depends on: 29335
Blocks:
  Show dependency treegraph
 
Reported: 2006-12-18 14:50 UTC by Kaveh Ghazi
Modified: 2007-05-07 07:35 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-12-24 03:33:42


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kaveh Ghazi 2006-12-18 14:50:39 UTC
We should use MPFR to evaluate c99 lgamma function (and the common extension function gamma).  However we have to wait until MPFR implements a suitable interface as described here:

http://gforge.inria.fr/plugins/scmsvn/viewcvs.php/trunk/TODO?root=mpfr&rev=4214&r1=4205&r2=4214
Comment 1 Andrew Pinski 2006-12-24 03:33:42 UTC
Confirmed.
Comment 2 Kaveh Ghazi 2007-05-07 07:35:38 UTC
I'll be doing the reentrant lgamma_r/gamma_r versions as well.  (They're actually easier because I get the signgam identifer as a pointer parameter rather than having to find it at global scope.)

Comment 3 patchapp@dberlin.org 2007-05-07 17:05:17 UTC
Subject: Bug number PR middle-end/30250

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-05/msg00408.html
Comment 4 patchapp@dberlin.org 2007-05-10 08:14:36 UTC
Subject: Bug number PR middle-end/30250

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-05/msg00619.html
Comment 5 Kaveh Ghazi 2007-05-19 05:18:27 UTC
Subject: Bug 30250

Author: ghazi
Date: Sat May 19 04:18:05 2007
New Revision: 124849

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124849
Log:
	PR middle-end/30250
	* builtins.c (do_mpfr_lgamma_r): New.
	(fold_builtin_2): Handle builtin gamma_r/lgamma_r.
	* tree.h (CASE_FLT_FN_REENT): New.

testsuite:
	* gcc.dg/torture/builtin-math-2.c: Add gamma_r/lgamma_r tests.
	* gcc.dg/torture/builtin-math-4.c: Likewise.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtins.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/torture/builtin-math-2.c
    trunk/gcc/testsuite/gcc.dg/torture/builtin-math-4.c
    trunk/gcc/tree.h