From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 2468B38312B3 for ; Wed, 29 Jun 2022 12:13:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2468B38312B3 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-517-0dut9d1xNvGYsY0ICiFTog-1; Wed, 29 Jun 2022 08:13:05 -0400 X-MC-Unique: 0dut9d1xNvGYsY0ICiFTog-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 66F6D3C11E67; Wed, 29 Jun 2022 12:13:05 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2821E9D63; Wed, 29 Jun 2022 12:13:05 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 25TCD22n3998459 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 29 Jun 2022 14:13:03 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 25TCD2dB3998458; Wed, 29 Jun 2022 14:13:02 +0200 Date: Wed, 29 Jun 2022 14:13:01 +0200 From: Jakub Jelinek To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] libgfortran: Fix up LIBGFOR_CHECK_FLOAT128 [PR106137] Message-ID: Reply-To: Jakub Jelinek MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jun 2022 12:13:10 -0000 Hi! My recent gfortran + libgfortran patch apparently broke (some?) aarch64 builds. While it is desirable to use just _Float128 rather than __float128, we only want to use it (and e.g. define HAVE_FLOAT128) on targets where _Float128 is supported and long double isn't IEEE quad precision. Which is targets that support __float128 type which we have been testing for before - _Float128 is supported on those targets and on targets where long double is IEEE quad precision. So, the following patch restores check for whether __float128 is supported into the LIBGFOR_CHECK_FLOAT128 check which determines whether HAVE_FLOAT128 is defined or whether to use libquadmath, so that e.g. on aarch64 where long double is IEEE quad we don't do that. Tested by Tamar on aarch64 and by me on x86_64-linux, ok for trunk? 2022-06-29 Jakub Jelinek PR bootstrap/106137 * acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Also test for __float128. * configure: Regenerated. --- libgfortran/acinclude.m4.jj 2022-06-28 13:14:45.327799267 +0200 +++ libgfortran/acinclude.m4 2022-06-29 11:45:19.286551469 +0200 @@ -276,7 +276,6 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [ GCC_TRY_COMPILE_OR_LINK([ _Float128 foo (_Float128 x) { - _Complex _Float128 z1, z2; z1 = x; @@ -290,11 +289,18 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [ { return x * __builtin_huge_valf128 (); } + + __float128 baz (__float128 x) + { + return x * __builtin_huge_valf128 (); + } ],[ foo (1.2F128); bar (1.2F128); + baz (1.2F128); foo (1.2Q); bar (1.2Q); + baz (1.2Q); ],[ libgfor_cv_have_float128=yes ],[ --- libgfortran/configure.jj 2022-06-28 13:14:45.331799215 +0200 +++ libgfortran/configure 2022-06-29 11:45:49.951148846 +0200 @@ -30130,7 +30130,6 @@ else _Float128 foo (_Float128 x) { - _Complex _Float128 z1, z2; z1 = x; @@ -30145,14 +30144,21 @@ else return x * __builtin_huge_valf128 (); } + __float128 baz (__float128 x) + { + return x * __builtin_huge_valf128 (); + } + int main () { foo (1.2F128); bar (1.2F128); + baz (1.2F128); foo (1.2Q); bar (1.2Q); + baz (1.2Q); ; return 0; @@ -30177,7 +30183,6 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ _Float128 foo (_Float128 x) { - _Complex _Float128 z1, z2; z1 = x; @@ -30192,14 +30197,21 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ return x * __builtin_huge_valf128 (); } + __float128 baz (__float128 x) + { + return x * __builtin_huge_valf128 (); + } + int main () { foo (1.2F128); bar (1.2F128); + baz (1.2F128); foo (1.2Q); bar (1.2Q); + baz (1.2Q); ; return 0; Jakub