From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp01.smtpout.orange.fr [80.12.242.123]) by sourceware.org (Postfix) with ESMTPS id 26DF93858D32 for ; Mon, 19 Sep 2022 20:50:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 26DF93858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orange.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=orange.fr Received: from [192.168.1.17] ([86.215.174.255]) by smtp.orange.fr with ESMTPA id aNiUozicjTLjwaNiUoh67k; Mon, 19 Sep 2022 22:50:11 +0200 X-ME-Helo: [192.168.1.17] X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Mon, 19 Sep 2022 22:50:11 +0200 X-ME-IP: 86.215.174.255 Message-ID: <0a36f845-13fb-5046-7731-87f4832e8deb@orange.fr> Date: Mon, 19 Sep 2022 22:50:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH 09/10] fortran: Support clobbering of variable subreferences [PR88364] Content-Language: en-US To: Harald Anlauf , Thomas Koenig , Richard Biener Cc: 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> <3edab734-f5bb-5557-ff98-b0ce47d7c510@orange.fr> <3ef8c5c4-35a1-fa60-2a2d-a7bb3fbd35fc@gmx.de> <9996bd59-9cf1-12df-faa5-7d546e5732f7@orange.fr> <6ac60050-2298-df01-1345-d53c868ed5d9@gmx.de> From: Mikael Morin In-Reply-To: <6ac60050-2298-df01-1345-d53c868ed5d9@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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: Le 19/09/2022 à 21:46, Harald Anlauf a écrit : > Am 18.09.22 um 22:55 schrieb Mikael Morin: >> Le 18/09/2022 à 20:32, Harald Anlauf a écrit : >>> >>> Assumed shape will be on the easy side, >>> while assumed size likely needs to be excluded for clobbering. >>> >> Isn’t it the converse that is true? >> Assumed shape can be non-contiguous so have to be excluded, but assumed >> size are contiguous, so valid candidates for clobbering. No? > > I really was referring here to *dummies*, as in the following example: > > program p >   integer :: a(4) >   a = 1 >   call sub (a(1), 2) >   print *, a > contains >   subroutine sub (b, k) >     integer, intent(in)  :: k >     integer, intent(out) :: b(*) > !   integer, intent(out) :: b(k) >     if (k > 2) b(k) = k >   end subroutine sub > end program p > > Assumed size (*) is just a contiguous hunk of memory of possibly > unknown size, which can be zero.  So you couldn't set a clobber > for the a(1) actual argument. > Couldn't you clobber A entirely? If no element of B is initialized in SUB, well, A has undefined values on return from SUB. That's how INTENT(OUT) works.