From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id A64893857804; Mon, 21 Jun 2021 15:51:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A64893857804 Received: by mail-wr1-x42d.google.com with SMTP id d11so17867630wrm.0; Mon, 21 Jun 2021 08:51:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=N9WrOF7Plug+JGD3azkD2hlxS3yM7/vaIT3ov1NZLeo=; b=ZE/AD924/ec6ntVTHF++oJQ3fpnMhkJx7bIqtFRY9os4nYTAKybltP49CEqQ+6WySf PqaxI5tle3zb4xkS1Tpnrhcw1oegM5xlYrAEbtr0VvC3DAsugJMhXsz2iFeJTz7Q9odJ gTHWITXwyC/Wzw5LtDGfR5fhIS17wmYpyfVy+oKCtsrRrF5/i1tXl9UmuBZtm73HXI00 JIkV4L63ruRD9olNNVQf7XO7XbwQaSGvzrnVcJ+/0z2KzIk1+rl0CHveLE+62yeqmuhO DVP5T83hpsP/HmoBnXQFADcnPkhZ680AW2NnCbQh8zUMRuFJYDNBFObox5MRonbjeHRu oEbA== X-Gm-Message-State: AOAM530Y9sKv55Tzg6Ao3mDklllDpP3m8qow49Q3V31M8ZV6pBNwV3z+ Dal4TA2xx5ab+nS4Kt8JeGErqtVfqzDXTA== X-Google-Smtp-Source: ABdhPJwIAbYFu5NA2fNb3T1d9BhvDnawBkx5PvzcjA9BOu4wCxaJBQZwqOv7AM/XZMgpveqOQMc4QQ== X-Received: by 2002:a5d:5984:: with SMTP id n4mr29749640wri.294.1624290707534; Mon, 21 Jun 2021 08:51:47 -0700 (PDT) Received: from ?IPv6:2001:8a0:7d79:6000:9ef3:95cc:cfcc:7e5f? ([2001:8a0:7d79:6000:9ef3:95cc:cfcc:7e5f]) by smtp.googlemail.com with ESMTPSA id p20sm9525275wma.19.2021.06.21.08.51.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Jun 2021 08:51:46 -0700 (PDT) Subject: Re: [Patch, fortran V2] PR fortran/93308/93963/94327/94331/97046 problems raised by descriptor handling To: Tobias Burnus , fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org References: <0b4b1feb-aa45-31ab-9185-546bd0cc551a@gmail.com> From: =?UTF-8?Q?Jos=c3=a9_Rui_Faustino_de_Sousa?= Message-ID: <164eff68-d663-f3e3-31b0-ca0349a91dd3@gmail.com> Date: Mon, 21 Jun 2021 15:51:45 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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 15:51:50 -0000 On 21/06/21 13:46, Tobias Burnus wrote: > Hi José, > > (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? Since fixing: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100917 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100910 would very likely require passing an additional "kind" parameter (and future descriptor unification) that would be a good idea. I had a patch to do this, passing the kind value, but AFAIR there were issues with kind values for C_PTR and C_FUNPTR (and I didn't want to mess with the ABI also in one go)... But I might have fixed that somewhere else afterwards... So, I could look further into that. Were would you like them placed? > LGTM – except for one minor nit. In trans-expr.c's > gfc_conv_gfc_desc_to_cfi_desc: > >    /* Transfer values back to gfc descriptor.  */ > +  if (cfi_attribute != 2 > +      && !fsym->attr.value > +      && fsym->attr.intent != 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... What do you suggest I do? Best regards, José Rui