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] PR middle-end/30250: Evaluate lgamma/gamma at compile-time using MPFR


On 5/8/07, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> 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.

Thanks,
Andrew Pinski


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