From patchwork Sun Feb 17 13:18:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 221059 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 2E26D2C0040 for ; Mon, 18 Feb 2013 00:18:23 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1361711904; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=zusrLzBGU2qkDZ6Eq5tg47KRXrE=; b=msj3vkGgCJRXN8K pINgBlGSWuzszHXsJsHN0ccIynW4fwopKnOR/DWf7EbWOpm9Yto5CFrKWt8gf6rl I1CrfEIxzUT4dK0DF+dN0xzrmwDP1q1/lyO4A7ls6QhCUeNhN9y/YfhGvuVNCudJ un0m5LhF1UG+abY695y/GL7xTsps= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=YApDdm1aCjHQlwlG/jLv19s8uUElquRPKStStyqNN28LmfTcUEOF8nX/vOtoPg YxMznPWkic9Opg58DNqyadge3JIzpm5sHJ1onIHNxNtL17jqB/6tJGwsVsbv8qdJ o7nOVuL1co0S07lKvqLR2qAd8I7oVPxKH1UhUwNAlyY7Q=; Received: (qmail 16220 invoked by alias); 17 Feb 2013 13:18:14 -0000 Received: (qmail 16177 invoked by uid 22791); 17 Feb 2013 13:18:13 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RCVD_IN_DNSWL_NONE, TW_OG X-Spam-Check-By: sourceware.org Received: from mx01.qsc.de (HELO mx01.qsc.de) (213.148.129.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 17 Feb 2013 13:18:05 +0000 Received: from archimedes.net-b.de (port-92-195-67-77.dynamic.qsc.de [92.195.67.77]) by mx01.qsc.de (Postfix) with ESMTP id C9B113CBAD; Sun, 17 Feb 2013 14:18:03 +0100 (CET) Message-ID: <5120D88A.9060905@net-b.de> Date: Sun, 17 Feb 2013 14:18:02 +0100 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2 MIME-Version: 1.0 To: Tilo Schwarz CC: fortran@gcc.gnu.org, gcc patches Subject: [Patch, libquadmath, committed] fix signbit call (was: Re: Test failures when compiling gfortran/libquadmath with -O0) References: In-Reply-To: Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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