From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 5E12D3858018; Wed, 10 Mar 2021 09:23:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5E12D3858018 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=mentor.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Tobias_Burnus@mentor.com IronPort-SDR: cY6sKNRlYALlFtsIMrTNBzSeDUiXHcG9+U8iqVG8gBc7cz6FvDyswIi0hiazj+NoZAzduH80Yf TEuc3PNT6TCbLT6q9w0356DeP/ZLPLftquUPlWkBA7LQExsyM1eUnfjkJeuV7EdetoYScMVDxq ze9LiA6SwoLIbuiMgHgEICW4E9Ceerjiq8su5dUaW7XYMFKMyN0DcBlItVkVkzh1fHZKbnTrRg 7qmr5O7DTPVOX+4zUHUxulwNZc+qQ0FcVr8RrFtU0sAmRuWKPMHepXV+rNVxmiP48lrFxSvtSc pw8= X-IronPort-AV: E=Sophos;i="5.81,237,1610438400"; d="scan'208";a="59068046" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 10 Mar 2021 01:23:43 -0800 IronPort-SDR: +bqGc0fZLyDYEFIPNTgtTO+VuCCtzfflCfXCCYjUiKn8InnjjrTrxE2sbtdIshBXoC1JbNtXB/ dG/Xzafxc72xM3ALHF/PqEadnoJzOeV87ym60kt3PA+aC6i7+qB0Xqq2616JDHD9HVzxxE7fJ7 LY31VhdrtWl4KsXD0vAl2jfLK0MT/vWG16wdiHcTin2MvAJNKoYTIaa3ci7clI5V9odBuLqLYt BdB6aZTnchGMQqUMjthbhCDXEFkKiVnGR/KX+qj0oVU0JVdxrgoDR4TBuuHbY+G61ghTMesaB1 jQQ= Subject: Re: [patch] Fix PR fortran/96983 To: Eric Botcazou , fortran CC: gcc-patches References: <5050796.fM2REodTD2@fomalhaut> From: Tobias Burnus Message-ID: <3ffe91c1-4da4-ecd9-1d16-c0135af1c3e9@mentor.com> Date: Wed, 10 Mar 2021 10:23:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <5050796.fM2REodTD2@fomalhaut> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-08.mgc.mentorg.com (139.181.222.8) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_NUMSUBJECT, KAM_SHORT, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, 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: 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, 10 Mar 2021 09:23:46 -0000 Hi, On 08.03.21 17:25, Eric Botcazou wrote: > AFAICS the code in build_round_expr implicitly assumes that __float128 ex= ists, > which is *not* the common case among 64-bit architectures since "long dou= ble" > is generally already 128-bit for them. Crossref: Introduced by the Patch for PR96711, https://gcc.gnu.org/pipermai= l/fortran/2020-August/054920.html Its testcase causes the fails/this PR, hence, gfortran.dg/pr96711.f90 is th= e testcase for this patch. > Tested on x86-64/Linux and SPARC64/Linux, OK for the mainline? > > 2021-03-08 Eric Botcazou > > PR fortran/96983 > * trans-intrinsic.c (build_round_expr): Do not implicitly assume > that __float128 is the 128-bit floating-point type. I think it is a bad idea to hard-code the real type. Does the following work for you? If so, I think that patch is obvious and you can go ahead and commit it. --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -407,7 +407,7 @@ build_round_expr (tree arg, tree restype) if (kind < 0) gfc_internal_error ("Could not find real kind with at least %d bit= s", resprec); - arg =3D fold_convert (gfc_float128_type_node, arg); + arg =3D fold_convert (gfc_get_real_type (kind), arg); fn =3D gfc_builtin_decl_for_float_kind (BUILT_IN_ROUND, kind); } else Tobias ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 M=FCnchen Regi= stergericht M=FCnchen HRB 106955, Gesch=E4ftsf=FChrer: Thomas Heurung, Fran= k Th=FCrauf