This is the mail archive of the
mailing list for the GCC project.
[Patch, libquadmath, committed] fix signbit call (was: Re: Test failures when compiling gfortran/libquadmath with -O0)
- From: Tobias Burnus <burnus at net-b dot de>
- To: Tilo Schwarz <tilo at tilo-schwarz dot de>
- Cc: fortran at gcc dot gnu dot org, gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 17 Feb 2013 14:18:02 +0100
- Subject: [Patch, libquadmath, committed] fix signbit call (was: Re: Test failures when compiling gfortran/libquadmath with -O0)
- References: <email@example.com>
Tilo Schwarz wrote:
I built gfortran with -O0 in order to follow some gfortran code paths
Now I noticed, that many of the tests in the fortran testsuite fail,
undefined reference to `signbit'
I was wondering
- if that is on purpose
- if I am doing something wrong
- if there is an easy workaround (trying to link with -lm did not help).
I think it is a bug of mine (from 2012-11-01) when converting from
GLIBC. signbit is a macro which gets translated into
__signbitf/__signbit/__signbitl; thus, "signbit" is not in any library.
Still, I don't understand why it only fails without optimization – I had
expected that it either gets translated into __signbitl – thus,
"signbit" shouldn't appear in the error message. Or that is remains as
is – but that should fail also with optimization.
I have now committed the attached patch (as Rev. 196109).
PS: At some point (in 4.9), the following commits should be ported from
GLIBC to libquadmath:
Fix casinh spurious underflows away from [-i,i] (bug 15062).
Fix cacos real-part inaccuracy for result real part near 0 (bug 15023).
Fix casinh, casin overflow (bug 14996).
Fix casinh, casin inaccuracy from cancellation (bug 14994).
Fix powl inaccuracy for x86_64 and x86 (bug 13881).
and finally get some test-suite running, based on the GLIBC version.
--- libquadmath/ChangeLog (Revision 196108)
+++ libquadmath/ChangeLog (Arbeitskopie)
@@ -1,3 +1,7 @@
+2013-02-17 Tobias Burnus <firstname.lastname@example.org>
+ * math/cacoshq.c (cacoshq): Call signbitq instead of signbit.
2013-02-06 Richard Sandiford <email@example.com>
Revert previous patch.
--- libquadmath/math/cacoshq.c (Revision 196108)
+++ libquadmath/math/cacoshq.c (Arbeitskopie)
@@ -70,7 +70,7 @@
some cases. */
res = 2.0Q * clogq (csqrtq ((x + 1.0Q) / 2.0Q)
+ csqrtq ((x - 1.0Q) / 2.0Q));
- if (signbit (__real__ res))
+ if (signbitq (__real__ res))
__real__ res = 0.0Q;