This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] PR middle-end/30250: Evaluate lgamma/gamma at compile-time using MPFR
- From: "Andrew Pinski" <pinskia at gmail dot com>
- To: "Kaveh R. GHAZI" <ghazi at caip dot rutgers dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 8 May 2007 23:20:37 -0700
- Subject: Re: [PATCH] PR middle-end/30250: Evaluate lgamma/gamma at compile-time using MPFR
- References: <Pine.GSO.firstname.lastname@example.org>
On 5/8/07, Kaveh R. GHAZI <email@example.com> wrote:
I found I needed to use identifier_global_value() to grab a handle on
signgam. This function only appears in the C-family frontends. So I
ended up deciding to use a langhook. The langhook defaults to returning
NULL_TREE which stops the transformation in most languages. From the
C-family, c_get_signgam() will return a usable tree for signgam if it's
been declared extern int at that point in the user's code. (Simply
including math.h will declare it in conforming C99 libc implementations.)
I didn't bother to declare signgam on-the-fly if it wasn't found since I
wasn't sure that was safe.
langhooks are bad will not work in LTO. A better way is to add a
function to libgcc for setting of signgam and a configure test for
signgam in libgcc to check if it exists and the function would just
simply not do anything if it does not exist.
I will repeat again, langhooks are BAD.