From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by sourceware.org (Postfix) with ESMTPS id F24833852C40; Wed, 14 Dec 2022 19:26:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F24833852C40 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1671045994; bh=nCPbhAjb1WrGwOuM22c+7tdkCy5oHmmyuD43JwmTPyg=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=B41Lw6YtdxqcAN1WFtTFsY1dDFgs2714Uk3PqiVP8zlple158+6XI72XJWTfqQzeP /ReTY4ktk2uCfozZCp5ap2it2RF2k68Z8gWBNuz0ap+nAzBnponbr9mKqk2zVEtjRT myG7+o1LjOwauebaxkEzgbdTogYdMAgD9Kl9rVGwJeXQtk9HSIBigeZDu+ChFbyqLi BoI5H5o54UOoA1p018GDRjLtUHUfCLQWRm4NXEQbXuORmQYb3lJ75BbsswvIciPqJo WPkvZPqb/jQXOe3JKM/py/gcaLd57nb5FXXavyIwjZ30U8aaW6gQektA0ajszrlCzO XI1A4OVP0pDzQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.178.29] ([93.207.82.34]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MDhlV-1pF82Q3VJf-00AqsU; Wed, 14 Dec 2022 20:26:33 +0100 Message-ID: <6b3f24aa-efff-b462-0c5f-26772cfd462a@gmx.de> Date: Wed, 14 Dec 2022 20:26:30 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [Patch, Fortran] libgfortran's ISO_Fortran_binding.c: Use GCC11 version for backward-only code [PR108056] To: Tobias Burnus , gcc-patches , fortran Newsgroups: gmane.comp.gcc.patches,gmane.comp.gcc.fortran References: <1faf5680-9f5a-1f9d-4a9d-4eaff8982056@codesourcery.com> <86a8d0f0-e3e3-3abe-f024-149615d2af4b@codesourcery.com> Content-Language: en-US From: Harald Anlauf In-Reply-To: <86a8d0f0-e3e3-3abe-f024-149615d2af4b@codesourcery.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:89sYKEYe8/2MqQ8DPN8KspTc6dzLqqXmsNKDWXciIkdYqC6N+49 +fJJvo7ZUUO22Ik2NRbtuzcdSNfABPAZzd4uOSY0L0q6gW4kd6hJTOcperIhu1JQLwo1YQ/ 6bJBVcETrTjK83P7rxKHuDqfltrcWjOIj3pOqXQMkwvIC/07vr0VVixapDzYDiXLaAbooLu hITqhXX1rIFULy8uT5OEg== UI-OutboundReport: notjunk:1;M01:P0:WYmpHX3F2ak=;vX6YwR1K1G1c60DcCZFV8/tjzeE Va8nneHsgbuJRz/xjSbMa9nrC8BYYQmmDUdykyb60IYtMj58JfLJbHdHR1lExwhALWreJPM4O xTUibSlvXo1rB8g+Z4Cu79kfflzkMCID8UL/m0BvPFdM8kbq4xztwLy0lFpR3tbGJR5ZyexQB WmnzIF7dlepiLTOVw309Euk0ncG2217uLQjYrmO2y0RGI+0mZ0OCSW/Cnw0iL/cGjQ9HEVIQL dnPCjurYohG4i6jqs/Ai8VT2Zi5GzjIMpTTTEsZ/46qdg+lg0o9psry+PHojprU7bZZNxEyQV 8S8lBHhkCmH6LDk4zyzat0djIdYVSjWMLi3Zgmdft12ZfJRtIi1dinKIlhPNLQ8d+W15ZvHAz l/K+JfTb4WrSX9UVq4PH4GCmradstUlHRC30q6OT1J+3GvtJi1K40oVI+KSQVlpfusnMSi6VY sQQgskmh0/w+gfMRgi1Um90nmojQ46/eyWWJ1P/IVNtIw3woJyE8L4Avm3JZGj5zNIf9ymdkC U8uEC1Jl7lqEq8wCf0Yu9vDHIhuerHXTmfSW1ydILZH3Xfz347hSpDNrDU2SRY62tNsibVxgs Z3dFXxw3kMHQU5A/TERCs+WkuXr++rc3kGKv+h0rPZ9/K4y4QV6tbYr8Mb7KmGqmU3Y1JbiAu mrL453cA2OnpRAqPtc0BsHi/TpCVC+Z6FngVpZaqX/i906Xb+pg/g1f6l8ydtqYFcEphxW9ZN QgCz/ItkMpmq+kss640b3iKZG6rxrKnddyQlj8G+YaML/N357/cQWC0RgxI76BKRBoLaC4Hyc xOaHV7hvPkOADBsCS61JdeaoZTiD0BnIXMwwOMnrbtWpF8hn4+vdhMuGDtqihH3YW4jiBPhDm S+v3V3gKW7oxrAiaCxybleSoVSPcHsUP0u1/EqebxsK/9Mrnm0DdLWeALeciqcmOut6Gr//9f qMUvAd8v2MIt1vH6CHkY2C2gFCs= X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Message-ID: <20221214192630.M9k3yrCjRejCE1BA6t5wvu64rDagqdsEe2OpMT8grxc@z> Hi Tobias, thanks for your explanation! Now things are clearer. Am 14.12.22 um 08:57 schrieb Tobias Burnus: >>> @@ -63 +66 @@ cfi_desc_to_gfc_desc (gfc_array_void *d, >>> -=C2=A0 d->dtype.version =3D s->version; >>> +=C2=A0 d->dtype.version =3D 0; >> >> I was wondering what the significance of "version" is. >> In ISO_Fortran_binding.h we seem to always have >> =C2=A0=C2=A0 #define CFI_VERSION 1 >> and it did not change with gcc-12. > > The version is 1 for CFI but it is 0 for GFC. However, as we do not > check the GFC version anywhere and it is not publicly exposed, it does > not really matter. Still, "d->dtype.version =3D 0;" matches what the > compiler itself produces =E2=80=93 and for consistency, setting it to 0 = is > better than setting it to 1 (via CFI's version field). > > Actually 'dtype.version' is not really set anywhere; at least > gfc_get_dtype_rank_type(...) does not set it; zero initialization is > most common but it could be also some random value. In libgfortran, > GFC_DTYPE_CLEAR explicitly sets it to 0. OK, that was not easy to find. >>> @@ -107 +117 @@ gfc_desc_to_cfi_desc (CFI_cdesc_t **d_pt >>> -=C2=A0 d->version =3D s->dtype.version; >>> +=C2=A0 d->version =3D CFI_VERSION; >> >> This treatment of "version" was the equivalent to the above that >> confused me.=C2=A0 Assuming we were to change CFI_VERSION in gcc-13+, >> is this the right choice here regarding backward compatibility? > > I don't think we will change CFI version any time soon as we rather > closely follow the Fortran standard and I do not see any changes which > are required there. > > NOTE: As s->dtype.version is either 0 or some random value, setting > version in the CFI / ISO C descriptor to 1, be it as literal or as macro > constant, makes it the same as CFI_VERSION. OK > And: I don't think we will change CFI_VERSION or the structure of the > CFI array descriptor any time soon; there does not seem to be any need > for it, it matches the Fortran standard one well (and no plans seem to > be planed on that side) and, finally, changing an array descriptor is > painful! Agreed. > However, using '1;=C2=A0 /* CFI_VERSION in GCC 11 and at time of writing= . */' > would also work =E2=80=93 but I would expect that we will go through all= CFI > users if we ever change the descriptor (and bump the version), possibly > adding version-number dependent code. Agreed. Searching for a string that can be guessed is easier that looking for a magic '1'. >> So besides the "version" question ok from my side. > > I hope I could answer the latter. Yes, and thanks for the patch! Harald > 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 Gesellschaft: M=C3=BCnchen; > Registergericht M=C3=BCnchen, HRB 106955 >