From patchwork Sat Dec 1 01:37:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 203094 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 BAEDC2C008E for ; Sat, 1 Dec 2012 12:37:38 +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=1354930660; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:Date:To:Subject:User-Agent:MIME-Version: Content-Type:Content-Transfer-Encoding:Message-ID:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=V914iXog8ZIngedZ+h51Ej+Qo7g=; b=NBiATqfDgORhEOwJGeNJtnKPA0+mUwIlImVCiaKuThlJ1QRv3t6B+TGHgSi4rc TareF7KNWQwbL//tKuGw5NfX8HcDyNNEtFsDzG/AlbWt3dY7orioakZTHJkv1KiA SZuLiV2O2yVrHqUm6ioVnfiC5NhdBoiyFEcLBpxnf2gMM= 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:X-M-MSG:Received:Received:Received:From:Date:To:Subject:User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID:X-EMS-Proccessed:X-EMS-STAMP:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=nHeiP8r2GnsjSDtY0+ETcINoqB1nIlywdR8oGMkUNo7g0HE02gn+zNecsNbn8I TjLfnsGiGm9uGxAQpqd/lLXQ/i++nLNI61Y+6Kw2efi5xdWUAeiMaXSytttJ4kw/ wa02gaxoZic/1Obsy5gFX7xag3j4W9R2jlexlWYowenO8=; Received: (qmail 27617 invoked by alias); 1 Dec 2012 01:37:32 -0000 Received: (qmail 27526 invoked by uid 22791); 1 Dec 2012 01:37:30 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from dns1.mips.com (HELO dns1.mips.com) (12.201.5.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 01 Dec 2012 01:37:25 +0000 Received: from mailgate1.mips.com (mailgate1.mips.com [12.201.5.111]) by dns1.mips.com (8.13.8/8.13.8) with ESMTP id qB11bM7c029418 for ; Fri, 30 Nov 2012 17:37:22 -0800 X-M-MSG: Received: from exchdb01.mips.com (unknown [192.168.36.84]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mailgate1.mips.com (Postfix) with ESMTP id 2BDFA364636 for ; Fri, 30 Nov 2012 17:37:18 -0800 (PST) Received: from ubuntu-sellcey.mips.com (192.168.65.53) by exchhub01.mips.com (192.168.36.84) with Microsoft SMTP Server id 14.1.270.1; Fri, 30 Nov 2012 17:37:12 -0800 Received: by ubuntu-sellcey.mips.com (sSMTP sendmail emulation); Fri, 30 Nov 2012 17:37:13 -0800 From: "Steve Ellcey " Date: Fri, 30 Nov 2012 17:37:13 -0800 To: Subject: [patch, libgcc] Bug in fp-bit.c when NO_NANS is defined User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Message-ID: <3fb4ebdd-4f24-4946-bfde-b0a1ae251bf9@EXCHHUB01.MIPS.com> X-EMS-Proccessed: 6LP3oGfGVdcdb8o1aBnt6w== X-EMS-STAMP: XmMrQfl2DCtjnXfOegSNdg== 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 While investigating some soft-float issues I tried compiling fp-bit.c in libgcc with NO_NANS defined. I wound up with an undefined reference to makenan. Here is my attempt at a patch to fix the problem but I am not sure if returning 0 is the right thing to do for b/0 when NO_NANS is defined. isinf is always going to be false when NO_NANS is defined so it is only a question of what to do for iszero(a) that we need to worry about. b at this point may or may not be zero. OK to checkin or should I return something else? Steve Ellcey sellcey@mips.com 2012-11-30 Steve Ellcey * fp-bit.c (_fpdiv_parts): Do not call makenan if NO_NANS defined. diff --git a/libgcc/fp-bit.c b/libgcc/fp-bit.c index 7509f76..10a6b3a 100644 --- a/libgcc/fp-bit.c +++ b/libgcc/fp-bit.c @@ -979,8 +979,10 @@ _fpdiv_parts (fp_number_type * a, if (isinf (a) || iszero (a)) { +#ifndef NO_NANS if (a->class == b->class) return makenan (); +#endif return a; }