From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 3AE731F8C6 for ; Sun, 29 Aug 2021 00:06:31 +0000 (UTC) Received: from localhost ([::1]:50336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mK8LF-0008Ae-Ve for normalperson@yhbt.net; Sat, 28 Aug 2021 20:06:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mK8LC-0008AS-V5 for bug-gnulib@gnu.org; Sat, 28 Aug 2021 20:06:26 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.216]:10463) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mK8LA-0001PT-Kt for bug-gnulib@gnu.org; Sat, 28 Aug 2021 20:06:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1630195581; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=zpEKcC657DZHDjo9C1HNwMmnRw1dMfayoYGJEnfLIzc=; b=SQpaFCn4A+UYNrKRZxOhRIl8hrk0F3N4uOxvhz4vowdOd3+xfohQ4uVTxdq7ajniSM Vihrt2tK4YO7dyqSgelJid1IVMq1pF0rA/fgiJGAMdveOK4bH5ZtoCSTXyKQrxzDq97e sW1OSDjd8JqUyuJZBgtyrLORlfWnNtTPuezu4VvzwxRg02e5pUmq6pCO6qqwezvFFk7y wOgTvDjh87uJaGi6nGKDLfpANbhQ54yaGSkt34zgZXpkc0K9OY6AMwSXZCQTVOGnH7H2 90KVVDpWx9qxTbWKB2ERIL3iCRoKlwS1G/VSP0cUJyBRWgjyfbHvMKmj3+SJkx2uPZuz pXJQ== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94z26ll5ip689kRYCRMhNyaHrKtI3tZ9C5tre" X-RZG-CLASS-ID: mo00 Received: from omega.localnet by smtp.strato.de (RZmta 47.31.0 AUTH) with ESMTPSA id I0beb9x7T06LoQa (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Sun, 29 Aug 2021 02:06:21 +0200 (CEST) From: Bruno Haible To: bug-gnulib@gnu.org Subject: fma: Fix compilation error on Linux/sh4 Date: Sun, 29 Aug 2021 02:06:20 +0200 Message-ID: <2947839.GKX7oQKdZx@omega> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=81.169.146.216; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" When compiling a testdir on Linux/sh4, I see this compilation error: ../../gllib/fma.c: In function 'rpl_fma': ../../gllib/fma.c:728:47: error: 'FE_DOWNWARD' undeclared (first use in this function); did you mean 'FP_INT_DOWNWARD'? 728 | else if (rounding_mode == FE_DOWNWARD) | ^~~~~~~~~~~ | FP_INT_DOWNWARD ../../gllib/fma.c:728:47: note: each undeclared identifier is reported only once for each function it appears in ../../gllib/fma.c:730:47: error: 'FE_UPWARD' undeclared (first use in this function) 730 | else if (rounding_mode == FE_UPWARD) | ^~~~~~~~~ make[3]: *** [Makefile:9372: fma.o] Error 1 The cause is that sh4 has only two among the four rounding modes. The other two are simply not defined in glibc's . 2021-08-28 Bruno Haible fma: Fix compilation error on Linux/sh4. * lib/fma.c (FUNC): Don't test for FE_DOWNWARD or FE_UPWARD when these rounding modes are not defined. diff --git a/lib/fma.c b/lib/fma.c index 3bddb30f3..bee05719c 100644 --- a/lib/fma.c +++ b/lib/fma.c @@ -725,10 +725,14 @@ FUNC (DOUBLE x, DOUBLE y, DOUBLE z) int rounding_mode = fegetround (); if (rounding_mode == FE_TOWARDZERO) round_up = 0; +# if defined FE_DOWNWARD /* not defined on sh4 */ else if (rounding_mode == FE_DOWNWARD) round_up = sign; +# endif +# if defined FE_UPWARD /* not defined on sh4 */ else if (rounding_mode == FE_UPWARD) round_up = !sign; +# endif #else /* Cf. */ int rounding_mode = FLT_ROUNDS;