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 CB4BE3858C00 for ; Sun, 18 Sep 2022 18:32:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CB4BE3858C00 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=m.gmane-mx.org Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oZz5S-0005pz-7n for gcc-patches@gcc.gnu.org; Sun, 18 Sep 2022 20:32:14 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gcc-patches@gcc.gnu.org From: Harald Anlauf Subject: Re: [PATCH 09/10] fortran: Support clobbering of variable subreferences [PR88364] Date: Sun, 18 Sep 2022 20:32:09 +0200 Message-ID: <3ef8c5c4-35a1-fa60-2a2d-a7bb3fbd35fc@gmx.de> References: <20220916202439.549820-1-mikael@gcc.gnu.org> <20220916202439.549820-10-mikael@gcc.gnu.org> <3edab734-f5bb-5557-ff98-b0ce47d7c510@orange.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: en-US In-Reply-To: Cc: fortran@gcc.gnu.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,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: Message-ID: <20220918183209.W8ceOzFVXzEEfHrCeUfwbQ96IhXNYJuqox8yGLvJDds@z> On 18.09.22 12:23, Thomas Koenig via Gcc-patches wrote: > > On 18.09.22 11:10, Mikael Morin wrote: >> It is unfortunate as there is some desirable behavior within reach here. > > I think some of the desired behavior can still be salvaged.  For > example, for > >   subroutine foo(a,n) >     integer :: n >     integer, dimension(n), intent(in) :: n integer, dimension(n), intent(out) :: a ! ? > ... > >   subroutine bar(a) >     integer, intent(out) :: a > > ... > >   integer :: a(3) > >   call foo(a,3) >   call foo(a(1),3) > > clobbers for the whole array can still be generated, but not for > >   call foo(a(2),2) > > so one would have to look at the lower bound. > > For this case, it would be helpful to clobber a range a(2:), but that > is a wishlist item for the future ;-) > > What is unsafe, currently, is > >   call bar(a(1)) We'll need a good coverage by testcases for the different handling required for assumed shape / assumed size / explicit size dummies to avoid new regressions. Assumed shape will be on the easy side, while assumed size likely needs to be excluded for clobbering. Harald