From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cc-smtpout1.netcologne.de (cc-smtpout1.netcologne.de [89.1.8.211]) by sourceware.org (Postfix) with ESMTPS id 261653856243; Sat, 17 Sep 2022 17:03:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 261653856243 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=netcologne.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=netcologne.de Received: from cc-smtpin3.netcologne.de (cc-smtpin3.netcologne.de [89.1.8.203]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id EAEB212869; Sat, 17 Sep 2022 19:03:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=netcologne.de; s=nc1116a; t=1663434203; bh=MGIvukpl85h73k9fzdf6gx1WZSFrr6mGAcuqheHWLjo=; h=Message-ID:Date:Subject:To:References:From:In-Reply-To:From; b=ZsuImPjoIi+o9QVwiiiIH5p5UO0VO89/oxLHR1kUTHuyB6tT7Z0kGB+JBQf0fasxp NAYLnM1y00BK9wG3fBBMTXjWxh0r9VTTwC1H/OhsrMpql6TzyOXO8dSjEXj+yCCgYa 6v67xPGmpJ4M30N8HFafUxhfKKBuHXj2alk206gcSmrIev/FBtPS16rA5hLvuwAcfP yL76o1VbwBdhmjgIpzjs66vnQjX4w6RsCtPfEDlg1fibsYMBwkwi5GdFKD/SLmmXCV nccORhq5Rm+QJgnCqwrhBb96YGBKK6P5Pnip7ROsdKvl43AOLgYrwBpIngkS4N4R1T mgi1aq2oBcdQQ== Received: from [IPV6:2001:4dd7:1257:0:7285:c2ff:fe6c:992d] (2001-4dd7-1257-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de [IPv6:2001:4dd7:1257:0:7285:c2ff:fe6c:992d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by cc-smtpin3.netcologne.de (Postfix) with ESMTPSA id 99D1511E23; Sat, 17 Sep 2022 19:03:21 +0200 (CEST) Message-ID: Date: Sat, 17 Sep 2022 19:03:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 09/10] fortran: Support clobbering of variable subreferences [PR88364] Content-Language: en-US To: Mikael Morin , gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org References: <20220916202439.549820-1-mikael@gcc.gnu.org> <20220916202439.549820-10-mikael@gcc.gnu.org> From: Thomas Koenig In-Reply-To: <20220916202439.549820-10-mikael@gcc.gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-NetCologne-Spam: L X-Rspamd-Queue-Id: 99D1511E23 X-Spamd-Bar: - X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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: Hi Mikael, > This adds support for clobbering of partial variable references, when > they are passed as actual argument and the associated dummy has the > INTENT(OUT) attribute. > Support includes array elements, derived type component references, > and complex real or imaginary parts. > > This is done by removing the check for lack of subreferences, which is > basically a revert of r9-4911-gbd810d637041dba49a5aca3d085504575374ac6f. > This removal allows more expressions than just array elements, > components and complex parts, but the other expressions are excluded by > other conditions: substrings are excluded by the check on expression > type (CHARACTER is excluded), KIND and LEN references are rejected by > the compiler as not valid in a variable definition context. > > The check for scalarness is also updated as it was only valid when there > was no subreference. First, thanks a lot for digging into this subject. I have looked through the patch series, and it looks very good so far. I have a concern about this part, though. My understanding at the time was that it is not possible to clobber an individual array element, but that this clobbers anything off the pointer that this is based on. So, integer, dimension(3) :: a a(1) = 1 a(3) = 3 call foo(a(1)) would also invalidate the store to a(3). Is my understanding correct? If so, I think this we cannot revert that patch (which was introduced because of a regression). Best regards Thomas