From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id D9F2B3858402; Tue, 14 Sep 2021 15:16:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D9F2B3858402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: c+woGcXTjY2HGwWU0+ksUFYE/BLgofOMHrR3wQGTXt6SLK0QwLPO08m0z72KB7aaF+Z4a81/sN FSwneWEII4UuPgj0+9UJ+DJQ/F7XYyPyrOOXf7+8NfdZdXG/tLWHxO1VQDqeAAPcrgP4ldA6bi jZDNKw1O7hOvhIECSmbeXn5BHZ+YY0w+8vCmuSTMGASa+FeI/isxQ8wwSXDMawGiEbFNB+LZaA oAsRbe3wcdOpKEzd034pCB6UcSaXW1uBVrLZVf8qyI8NclPppT4N0PscG6uMglCFnEn3BaNZCx ZOJ+G9b7HMpaJOdUuAplGASL X-IronPort-AV: E=Sophos;i="5.85,292,1624348800"; d="scan'208";a="68346834" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 14 Sep 2021 07:16:29 -0800 IronPort-SDR: ej/D8ky31NWT7G708EN6Rgxd8fyRCyWQeOstZgtazZl7BoBpfIYcAzsxOeTx6FFbYMbrFFDock wXzYq1ps5yV437IPfsXHuJ6UZQ2j7Zq6aCIcsFtXVBJZTbrIg0baxI2yGc4A93sy8MoQGW4a9P LE/opZWstgRmoxBXjkap6Ye3YO73eOD34g/ckbRdyCctWgSOhHptNPE5jUBH4cuVSubUDGa/hK +5Gb7X1nfExMj4+wQ8vU8ylYLZEYbNYA9PZMIPfPOsDkNdPnXZ4zX8ZXoKX+iHgZGMiuZ7ILYJ 8zQ= Subject: Re: [PATCH, Fortran] Revert to non-multilib-specific ISO_Fortran_binding.h To: Gerald Pfeifer CC: Sandra Loosemore , Andreas Tobler , , References: <4c32e0e7-7156-835a-30b-ada8c4b4482d@pfeifer.com> <2de2f2b0-d221-acc1-79d4-554ee480c62@pfeifer.com> From: Tobias Burnus Message-ID: <3eef3e69-4f10-62f8-a883-1c8ea27f810d@codesourcery.com> Date: Tue, 14 Sep 2021 17:16:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <2de2f2b0-d221-acc1-79d4-554ee480c62@pfeifer.com> Content-Type: text/plain; charset="utf-8"; 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.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 14 Sep 2021 15:16:31 -0000 Hi Gerald, I note: On 13.09.21 17:56, Gerald Pfeifer wrote: > % egrep -r '#define.*LDBL_(MANT_DIG|MIN_EXP|MAX_EXP)'/usr/include/ > /usr/include/x86/float.h:#define LDBL_MANT_DIG 64 > /usr/include/x86/float.h:#define LDBL_MIN_EXP (-16381) > /usr/include/x86/float.h:#define LDBL_MAX_EXP 16384 > > This looks like it matches existing Linux case already in place? On 14.09.21 16:50, Gerald Pfeifer wrote: > On Mon, 13 Sep 2021, Tobias Burnus wrote: >> Can you run 'echo | cpp -E -g3|grep DBL' to (or in the build dir: echo | >> ./gcc/cc1 -E -g3 -dD|grep DBL) to check what's the output? > Thank you, Tobias, and I'm just testing the proposed patch, but still > wanted to follow up on your question: > > % echo | ./gcc/cc1 -E -g3 -dD | grep DBL > #define __DBL_MANT_DIG__ 53 > #define __DBL_MIN_EXP__ (-1021) > #define __DBL_MAX_EXP__ 1024 > > #define __LDBL_MANT_DIG__ 53 > #define __LDBL_MIN_EXP__ (-16381) > #define __LDBL_MAX_EXP__ 16384 I note that LDBL_MANT_DIG is 53 as for "double" =E2=80=93 while Linux and your header file has 64. On the other hand, MIN/MAX_EXP for "long double" are larger than "double" =E2=80=93 and match the values from Linux and the size in your header file. Thus, the first question is: why does DBL_MANT_DIG differ (64 vs. 53)? And, related, does the following make sense and fixes the issue? --- a/libgfortran/ISO_Fortran_binding.h +++ b/libgfortran/ISO_Fortran_binding.h @@ -228,5 +228,5 @@ extern int CFI_setpointer (CFI_cdesc_t *, CFI_cdesc_t *= , const CFI_index_t []); /* This is the 80-bit encoding on x86; Fortran assigns it kind 10. */ -#elif (LDBL_MANT_DIG =3D=3D 64 \ +#elif ((LDBL_MANT_DIG =3D=3D 64 || LDBL_MANT_DIG =3D=3D 53) \ && LDBL_MIN_EXP =3D=3D -16381 \ && LDBL_MAX_EXP =3D=3D 16384) Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955