From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) by sourceware.org (Postfix) with ESMTPS id A1ACB385B512 for ; Wed, 24 Jan 2024 19:35:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A1ACB385B512 Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=m.gmane-mx.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A1ACB385B512 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=116.202.254.214 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706124922; cv=none; b=I3z1lPM7u9WBB3fwegk03Fna2es6+Phcuv7ItYRBsfpEMpUvfZlRi1IN8ANLPdR8TZ00DM39EiLG77l+a9rSOSUsqlv+R228fT6HRRiGhCEcnGGV9j6CaxIRgB3MZnO7+4V9rBq8hCTsmXUkE3VEgsiLOKsGLdGtRHr9tcGyDVs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706124922; c=relaxed/simple; bh=EP4o8VtULoTU3nNHKLqIMmfnlzdjsnMIM89rhBowYhM=; h=To:From:Subject:Date:Message-ID:Mime-Version; b=G8cEVYRkp7dAtArxXF/0kfdJwHM7UlQs5K5azTcNBb6Z0ZPpPBm4k+jDuaofxsLYJC8+7ddD/ds+xKS8Og028jbm0fBuxPf0pmZWlrR8hdg046jnc5qJccIPu4Jp7DuIiF/2bCk/3N9MfssQISyGtr/P2bgNGjBVU1/3FXoBkWo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rSj1p-0000VF-KT for gcc-patches@gcc.gnu.org; Wed, 24 Jan 2024 20:35:17 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: gcc-patches@gcc.gnu.org From: Harald Anlauf Subject: Re: [PATCH] Fortran: passing of optional dummies to elemental procedures [PR113377] Date: Wed, 24 Jan 2024 20:35:08 +0100 Message-ID: <754520cc-597a-4c96-b901-45a6b1998702@gmx.de> References: <2c7591cc-6660-4323-98b2-1b0a8f69628e@orange.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla Thunderbird Content-Language: en-US In-Reply-To: <2c7591cc-6660-4323-98b2-1b0a8f69628e@orange.fr> Cc: fortran@gcc.gnu.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,BODY_8BITS,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_NONE,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: Message-ID: <20240124193508.hgZu2RnX5AKY4pgZvIfaGm2ZUrmE9ELLRxdRMXRB0_4@z> Hi Mikael, Am 24.01.24 um 19:46 schrieb Mikael Morin: > 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. Duh! I completely missed that during cleanup. > 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. You're absolutely right. I've removed it. > Thanks for the patch. Thanks for the review! Harald > 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; >> > >