From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp-25.smtpout.orange.fr [80.12.242.25]) by sourceware.org (Postfix) with ESMTPS id 94DE03858C29; Wed, 24 Jan 2024 18:46:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 94DE03858C29 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=orange.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=orange.fr ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 94DE03858C29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=80.12.242.25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706122001; cv=none; b=Opljsqm91LNPa+M/OVvtjYz6DvH66S3DZLyCswDKdBi4cekVAu4ufDXbx8gIqdHq4YdQa7OxWrmjzuveFzg8iPMcg+/5k36HHcJPbI/brKh3CNVayN6jjulSb8GE9F2xcwitqMRNb3dxVgQQjrkqIgAI3UACS0QjN/DgogX/utY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706122001; c=relaxed/simple; bh=ozT5IXx2kZZkRbYw+tyMa8/Lg1fdhvrWmYV2eOQ+PeU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=TyGSDKd4+CAKAiVKZ1I3EFBQDhbnMjM0aP87SlmESpeFuYFo/uiozqadQ63K04IGk6ZZp1gSkOpKpXDINE6JROUE7kW0JGzXrHdShfamyGKusWjwIRqHnkxKmAoaOK6XMUHRaus7aG+YzErY3QeSAPuTLBHvf0+r11PM7BpKYXA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from [192.168.1.16] ([86.215.161.51]) by smtp.orange.fr with ESMTPA id SiGbrec5yYHX1SiGir4THy; Wed, 24 Jan 2024 19:46:37 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr; s=t20230301; t=1706121997; bh=GalVqxvoQ4eyChNyRt/5BXleR7ccjaiD6SionVUEh40=; h=Date:Subject:To:References:From:In-Reply-To; b=K/F9M+woBdP9h+QrAd6erM9wxLpdZKttw89yJTgoxfzHCZfPbvPrg1BeIIzU/xqaO kOhhW02N+Q2Ltxj1j3IlSCoq1hW/3UkOFf7NUaIPhIyBRTfANBPdrFBxibIbWYijiO kmQFqrB9CWzAM7mGA5ycYbLAkaw4VagrK9YM57K6uqmJ90eVSrBOaciB/rOnwTVWqp r2ydVkGcKOO05MIS4/0zuS925lrb0jf86oB0/Fl7tCjy2OeA+RQToecuB3p8m1dhTl aFB0yOlaG1gX/p9TgT2+UKtNzvk1gNBIz1C7k8RYbz2P/n+nGZ2A/LfXJARVp6WKjO J5Oo1nRkSOASg== X-ME-Helo: [192.168.1.16] X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Wed, 24 Jan 2024 19:46:37 +0100 X-ME-IP: 86.215.161.51 Message-ID: <2c7591cc-6660-4323-98b2-1b0a8f69628e@orange.fr> Date: Wed, 24 Jan 2024 19:46:30 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Fortran: passing of optional dummies to elemental procedures [PR113377] Content-Language: en-US To: Harald Anlauf , fortran , gcc-patches References: From: Mikael Morin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: Le 23/01/2024 à 21:36, Harald Anlauf a écrit : > Dear all, > > here's the second part of a series for the treatment of missing > optional arguments passed to optional dummies, now fixing the > case that the latter procedures are elemental. Adjustments > were necessary when the missing dummy has the VALUE attribute. > > I factored the code for the treatment of VALUE, hoping that the > monster loop in gfc_conv_procedure_call will become slightly > easier to overlook. > > Regtested on x86_64-pc-linux-gnu. OK for mainline? > Looks good, but... > Thanks, > Harald > > > diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc > index 128add47516..0fac0523670 100644 > --- a/gcc/fortran/trans-expr.cc > +++ b/gcc/fortran/trans-expr.cc > @@ -6392,12 +6479,23 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, > } > } > > + /* Scalar dummy arguments of intrinsic type with VALUE attribute. */ > + if (fsym > + && fsym->attr.value > + && !fsym->attr.dimension > + // && (fsym->ts.type != BT_CHARACTER > + // || gfc_length_one_character_type_p (&fsym->ts)) ... please remove the commented code here. OK with that change. The !fsym->attr.dimension condition could be removed as well as we are in the case of an elemental procedure at this point, but it doesn't harm if you prefer keeping it. Thanks for the patch. Mikael > + && fsym->ts.type != BT_DERIVED > + && fsym->ts.type != BT_CLASS) > + conv_dummy_value (&parmse, e, fsym, optionalargs); > + > /* If we are passing an absent array as optional dummy to an > elemental procedure, make sure that we pass NULL when the data > pointer is NULL. We need this extra conditional because of > scalarization which passes arrays elements to the procedure, > ignoring the fact that the array can be absent/unallocated/... */ > - if (ss->info->can_be_null_ref && ss->info->type != GFC_SS_REFERENCE) > + else if (ss->info->can_be_null_ref > + && ss->info->type != GFC_SS_REFERENCE) > { > tree descriptor_data; >