From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cvs.linux-mips.org (eddie.linux-mips.org [148.251.95.138]) by sourceware.org (Postfix) with ESMTP id A2AEA3858009; Tue, 24 Nov 2020 06:04:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A2AEA3858009 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux-mips.org Authentication-Results: sourceware.org; spf=none smtp.mailfrom=macro@linux-mips.org Received: from localhost.localdomain ([127.0.0.1]:46634 "EHLO localhost" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S23993055AbgKXGEeBJ8eg (ORCPT + 1 other); Tue, 24 Nov 2020 07:04:34 +0100 Date: Tue, 24 Nov 2020 06:04:33 +0000 (GMT) From: "Maciej W. Rozycki" To: Thomas Koenig cc: Martin Husemann , Anders Magnusson , Toon Moene , gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org Subject: Re: [PATCH 00/31] VAX: Bring the port up to date (yes, MODE_CC conversion is included) In-Reply-To: Message-ID: References: <6938275b-8a47-162e-fdcd-aac1412fa257@netcologne.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KHOP_HELO_FCRDNS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 06:04:38 -0000 On Tue, 24 Nov 2020, Maciej W. Rozycki wrote: > > > I don't know how or why __FLT_HAS_INFINITY is set for a target which > > > does not support it, but if you get rid of that macro, that particular > > > problem should be solved. > > > > Thanks for the hint; I didn't look into it any further not to distract > > myself from the scope of the project. I have now, and the check you have > > quoted is obviously broken (as are all the remaining similar ones), given: > > > > $ vax-netbsdelf-gcc -E -dM - < /dev/null | sort | grep _HAS_ > > #define __DBL_HAS_DENORM__ 0 > > #define __DBL_HAS_INFINITY__ 0 > > #define __DBL_HAS_QUIET_NAN__ 0 > > #define __FLT_HAS_DENORM__ 0 > > #define __FLT_HAS_INFINITY__ 0 > > #define __FLT_HAS_QUIET_NAN__ 0 > > #define __LDBL_HAS_DENORM__ 0 > > #define __LDBL_HAS_INFINITY__ 0 > > #define __LDBL_HAS_QUIET_NAN__ 0 > > $ > > > > which looks reasonable to me. This seems straightforward to fix to me, so > > I'll include it along with verification I am about to schedule (assuming > > that this will be enough for libgfortran to actually build; obviously it > > hasn't been tried by anyone with such a setup for a while now, as these > > libgfortran checks date back to 2009). > > Well, it is still broken, owing to NetBSD failing to implement POSIX 2008 > locale handling correctly, apparently deliberately[1], and missing > uselocale(3)[2] while still providing newlocale(3). This confuses our > conditionals and consequently: > > .../libgfortran/io/transfer.c: In function 'data_transfer_init_worker': > .../libgfortran/io/transfer.c:3416:30: error: > 'old_locale_lock' undeclared (first use in this function) > 3416 | __gthread_mutex_lock (&old_locale_lock); > | ^~~~~~~~~~~~~~~ > > etc. > > We can probably work it around by downgrading to setlocale(3) for NetBSD > (i.e. whenever either function is missing) unless someone from the NetBSD > community contributes a better implementation (they seem to prefer their > own non-standard printf_l(3) library API). And now: In file included from .../libgfortran/intrinsics/erfc_scaled.c:33: .../libgfortran/intrinsics/erfc_scaled_inc.c: In function 'erfc_scaled_r4': .../libgfortran/intrinsics/erfc_scaled_inc.c:169:15: warning: target format does not support infinity 169 | res = __builtin_inf (); | ^~~~~~~~~~~~~ In file included from .../libgfortran/intrinsics/erfc_scaled.c:39: .../libgfortran/intrinsics/erfc_scaled_inc.c: In function 'erfc_scaled_r8': .../libgfortran/intrinsics/erfc_scaled_inc.c:82:15: warning: floating constant exceeds range of 'double' 82 | xbig = 26.543, xhuge = 6.71e+7, xmax = 2.53e+307; | ^~~~ .../libgfortran/intrinsics/erfc_scaled_inc.c:169:15: warning: target format does not support infinity 169 | res = __builtin_inf (); | ^~~~~~~~~~~~~ and: .../libgfortran/intrinsics/c99_functions.c: In function 'tgamma': .../libgfortran/intrinsics/c99_functions.c:1866:3: warning: floating constant truncated to zero [-Woverflow] 1866 | static const double xminin = 2.23e-308; | ^~~~~~ .../libgfortran/intrinsics/c99_functions.c:1868:60: warning: target format does not support infinity 1868 | static const double xnan = __builtin_nan ("0x0"), xinf = __builtin_inf (); | ^~~~~~~~~~~~~{standard input}: Assembler messages: {standard input}:487: Fatal error: Junk at end of expression "QNaN" make[3]: *** [Makefile:6466: c99_functions.lo] Error 1 I am going to give up at this point, as porting libgfortran to non-IEEE FP is surely well beyond what I can afford to do right now. Maciej