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 56FFF385780A; Mon, 21 Jun 2021 16:47:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 56FFF385780A 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: +t6Da3dd/3QYS4nYKcz+aJ5QsSMBLblZap6/0vOv23ibrbDgPHBB+90GVjDC+ZwQ8VJTuUN+9O +SqhHWVCjjBIv/ACY/IHPLZbuhaBgK7BDcixKSYcirkTINBGEuGp533xOUZXmqa7KuPUvgSIwi CpLdJZmx5a6QTrvA67MF1B9v5LMMo3w71H0SM6Z8Unm6YZBv8UzgTaIdRkyOej8wNI/3l/wKxt aCEzZQJnv8krIZJKZadGJdGmwmAHO02pjLbrVeG51AaFcFSlBFQAi5/isKCFcuosMWpRgyD3o2 vCM= X-IronPort-AV: E=Sophos;i="5.83,289,1616486400"; d="scan'208";a="65066080" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 21 Jun 2021 08:46:46 -0800 IronPort-SDR: BggUMTgQotpm7N6A5tyB8u8rDHu5ohhiSYa1CRY021iAF9ec7BJxf9M4rMgGyUdqGsbgrRbWv+ Q6zVZWrPWnqGu1Fyqzaw7KJfg+klBqQkaoe/8a+7fZWkbWzIvEnamBobJgqIDzqwOAbQ59d0Ia 3GajK0mtCiwSue48lqNd9TglT2CR1ucpyo9GisJG5Mt7Zq+47ZQJVb5AcP1OirBzXnpBp1RDCE NZ4Js0CMeqxoMz+0BIRNeif/gVx0Db8DavCOguedRKbpfKCa3zNT0EFjWknj+SR5O6wk6ZTB0o cwo= Subject: Re: [Patch, fortran V2] PR fortran/93308/93963/94327/94331/97046 problems raised by descriptor handling To: =?UTF-8?Q?Jos=c3=a9_Rui_Faustino_de_Sousa?= , Tobias Burnus , , References: <0b4b1feb-aa45-31ab-9185-546bd0cc551a@gmail.com> <164eff68-d663-f3e3-31b0-ca0349a91dd3@gmail.com> From: Tobias Burnus Message-ID: Date: Mon, 21 Jun 2021 18:46:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <164eff68-d663-f3e3-31b0-ca0349a91dd3@gmail.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-06.mgc.mentorg.com (139.181.222.6) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, 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: Mon, 21 Jun 2021 16:47:08 -0000 Hi Jos=C3=A9, On 21.06.21 17:51, Jos=C3=A9 Rui Faustino de Sousa via Fortran wrote: > On 21/06/21 13:46, Tobias Burnus wrote: >> >> (in principle, I'd like to have the libgfortran function moved to the >> compiler proper to avoid some issues, but that's admittedly a task >> independent of your work.) > cfi_desc_to_gfc_desc and gfc_desc_to_cfi_desc from ISO_c_binding.c, > right? Yes. > > So, I could look further into that. Were would you like them placed? Well, as said: directly into the compiler where currently the call to libgomp is. >> LGTM =E2=80=93 except for one minor nit. Found a second tiny nit: + if (GFC_DESCRIPTOR_DATA (d)) + for (n =3D 0; n < GFC_DESCRIPTOR_RANK (d); n++) + { + CFI_index_t lb =3D 1; + + if (s->attribute !=3D CFI_attribute_other) There is tailing whitespace in the otherwise empty line. >> In trans-expr.c's gfc_conv_gfc_desc_to_cfi_desc: >> >> /* Transfer values back to gfc descriptor. */ >> + if (cfi_attribute !=3D 2 >> + && !fsym->attr.value >> + && fsym->attr.intent !=3D INTENT_IN) >> >> Can you add after the '2' the string ' /* CFI_attribute_other. */' >> to make the number less magic. > > Yes... I had the same idea... :-) But all those constants are defined > in "ISO_Fortran_binding.h"... And moving all those definitions would > be a major change... So I left it as it was... Well, I am currently only asking to add a comment after the "2;". This fixing those two nits (removing tailing whitespace + adding a comment) and is be trivial. * * * However, in the long run, I think we should put it into either a separate file, which is included into ISO_Fortran_binding.h and the proper compiler (and installed alongside ISO_Fortran_binding.h) - or just in libgfortran.h and adding some check/(static)assert that it matches to the value in ISO_Fortran_binding.h. Or, possibly, we could also include ISO_Fortran_binding.h when building the compiler itself, possibly adding some '#ifdef' code to disable parts we do not want when we do #include. it. (We already have '#include "libgfortran.h"' in gcc/fortran/gfortran.h.) Tobias ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 M=C3=BCnchen R= egistergericht M=C3=BCnchen HRB 106955, Gesch=C3=A4ftsf=C3=BChrer: Thomas H= eurung, Frank Th=C3=BCrauf