This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: PATCH: [Fortran] Fix mpfr_lgamma call with mpfr 2.3.x (was: Gcc mainline is broken)
- From: Tobias Burnus <burnus at net-b dot de>
- To: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>, "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 27 Aug 2007 11:52:00 +0200
- Subject: Re: PATCH: [Fortran] Fix mpfr_lgamma call with mpfr 2.3.x (was: Gcc mainline is broken)
- References: <200708270048.l7R0mX4k004790@hiauly1.hia.nrc.ca>
:ADDPATCH fortran:
John David Anglin wrote:
> Main is still broken for me:
>
Seemingly, I made a mistake when trying GCC with mpfr-2.3.0svn and it
picked the system mpfr (2.2.1); additionally I possibly used the syntax
of mpfr_lngamma instead of mpfr_lgamma (at least the syntax is wrong).
The following works for me and -fdump-tree-original shows that the
simplification works & thus the right library is used:
"print *, lgamma(1.0)"
shows the expected "static real8 C.1375 = 0.0;" (with mpfr 2.3.0svn).
Build on x86_64-unknown-linux-gnu with MPFR 2.3.0svn and the system MPFR
2.2.1 and regression tested.
Ok for the trunk?
Tobias
2007-08-27 Tobias Burnus <burnus@net-b.de>
* simplify.c (gfc_simplify_lgamma): Fix mpfr_lgamma call.
Index: simplify.c
===================================================================
--- simplify.c (Revision 127825)
+++ simplify.c (Arbeitskopie)
@@ -2235,6 +2235,7 @@ gfc_simplify_lgamma (gfc_expr *x __attri
{
#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
gfc_expr *result;
+ int sg;
if (x->expr_type != EXPR_CONSTANT)
return NULL;
@@ -2243,7 +2244,7 @@ gfc_simplify_lgamma (gfc_expr *x __attri
gfc_set_model_kind (x->ts.kind);
- mpfr_lgamma (result->value.real, x->value.real, GFC_RND_MODE);
+ mpfr_lgamma (result->value.real, &sg, x->value.real, GFC_RND_MODE);
return range_check (result, "LGAMMA");
#else