From patchwork Sun Feb 17 13:18:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [libquadmath, committed] fix signbit call (was: Re: Test failures when compiling gfortran/libquadmath with -O0) Date: Sun, 17 Feb 2013 03:18:02 -0000 From: Tobias Burnus X-Patchwork-Id: 221059 Message-Id: <5120D88A.9060905@net-b.de> To: Tilo Schwarz Cc: fortran@gcc.gnu.org, gcc patches Tilo Schwarz wrote: > I built gfortran with -O0 in order to follow some gfortran code paths > in gdb. > Now I noticed, that many of the tests in the fortran testsuite fail, > because of > .../gcc/build/i686-pc-linux-gnu/./libquadmath/.libs/libquadmath.so: > 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). Tobias 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. Index: libquadmath/ChangeLog =================================================================== --- libquadmath/ChangeLog (Revision 196108) +++ libquadmath/ChangeLog (Arbeitskopie) @@ -1,3 +1,7 @@ +2013-02-17 Tobias Burnus + + * math/cacoshq.c (cacoshq): Call signbitq instead of signbit. + 2013-02-06 Richard Sandiford Revert previous patch. Index: libquadmath/math/cacoshq.c =================================================================== --- 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; } else