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 A21E93858C74 for ; Tue, 20 Sep 2022 21:09:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A21E93858C74 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 1oakUE-0006RI-Sj for fortran@gcc.gnu.org; Tue, 20 Sep 2022 23:08:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: fortran@gcc.gnu.org From: Harald Anlauf Subject: Re: [PATCH 09/10] fortran: Support clobbering of variable subreferences [PR88364] Date: Tue, 20 Sep 2022 23:08:54 +0200 Message-ID: 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> <0a36f845-13fb-5046-7731-87f4832e8deb@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: <0a36f845-13fb-5046-7731-87f4832e8deb@orange.fr> Cc: gcc-patches@gcc.gnu.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,BODY_8BITS,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: Am 19.09.22 um 22:50 schrieb Mikael Morin: > 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. > I think I understand much of what is said, but I feel that I do not really understand what *clobber* means for the different beasts we are discussing (although I have an impression of what it means for a scalar object). From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by sourceware.org (Postfix) with ESMTPS id 755853858C55; Tue, 20 Sep 2022 21:08:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 755853858C55 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1663708135; bh=C3eaeSg5h2n8+oI0Udyr6VzJxObkpNuy/3wVbVx76ws=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=Tx92RzWlVGmYENGSn7x2JqVjjNwq2F68pPec2SvsTDnca26sR2IM/er3TVWuaMwPS AvzNEFVAsR/fC8CWbBTAbqHTWUOOzkMSaunQgCyghPKfGLeejQtdv2+AJxEYpV8wjU K4TSu8/5tVHOXdKZ2NcgdYDX5pHblFkPX+4n2Wn0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.29] ([93.207.88.67]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MeU0q-1pBBhL1Jwq-00aUZ9; Tue, 20 Sep 2022 23:08:55 +0200 Message-ID: Date: Tue, 20 Sep 2022 23:08:54 +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] To: Mikael Morin , Thomas Koenig , Richard Biener Cc: Mikael Morin , gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org Newsgroups: gmane.comp.gcc.fortran,gmane.comp.gcc.patches 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> <0a36f845-13fb-5046-7731-87f4832e8deb@orange.fr> Content-Language: en-US From: Harald Anlauf In-Reply-To: <0a36f845-13fb-5046-7731-87f4832e8deb@orange.fr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:MrLT79noSyPcYmAOs7TUEyVeJjok5UBF9MakHXn3wuw+L7U7uY1 00kTGt/NQ5ZyIzuySPazIUqUbZ3qBaLf9ctdk8zy8/lKCEvOZA5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QFD+8Ueg6MU6KLLAIaPqiXXullz4hEVAyQwu98uM1jqrx399CITtJLhiz hBGlAGv+BFgy026uUQxaZQXl0jlUG4n9hzVX0yqkpGH9DF1OIv5dmhyTFbjxMpeuqHvFSwkq6 LmDLt2Ac7mlUyRNN8702qggdQFsslOWXWempW7tTN0CHEpDl7+O/YW7UKnNAiu5SamcYKsIne QKMzl2TlXDtzQ43prjbzxJVT2833LnpMSoDoAST/eFtKwNKH2FrWvyuc9g2waTGOD+ZeXllLT 9f178= X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,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: Message-ID: <20220920210854.jEFIYvgHilDstaxwOvEranW14YHqog3iotom5RoxAJQ@z> Am 19.09.22 um 22:50 schrieb Mikael Morin: > Le 19/09/2022 =C3=A0 21:46, Harald Anlauf a =C3=A9crit=C2=A0: >> Am 18.09.22 um 22:55 schrieb Mikael Morin: >>> Le 18/09/2022 =C3=A0 20:32, Harald Anlauf a =C3=A9crit=C2=A0: >>>> >>>> Assumed shape will be on the easy side, >>>> while assumed size likely needs to be excluded for clobbering. >>>> >>> Isn=E2=80=99t it the converse that is true? >>> Assumed shape can be non-contiguous so have to be excluded, but assume= d >>> size are contiguous, so valid candidates for clobbering. No? >> >> I really was referring here to *dummies*, as in the following example: >> >> program p >> =C2=A0=C2=A0 integer :: a(4) >> =C2=A0=C2=A0 a =3D 1 >> =C2=A0=C2=A0 call sub (a(1), 2) >> =C2=A0=C2=A0 print *, a >> contains >> =C2=A0=C2=A0 subroutine sub (b, k) >> =C2=A0=C2=A0=C2=A0=C2=A0 integer, intent(in)=C2=A0 :: k >> =C2=A0=C2=A0=C2=A0=C2=A0 integer, intent(out) :: b(*) >> !=C2=A0=C2=A0 integer, intent(out) :: b(k) >> =C2=A0=C2=A0=C2=A0=C2=A0 if (k > 2) b(k) =3D k >> =C2=A0=C2=A0 end subroutine sub >> end program p >> >> Assumed size (*) is just a contiguous hunk of memory of possibly >> unknown size, which can be zero.=C2=A0 So you couldn't set a clobber >> for the a(1) actual argument. >> > Couldn't you clobber A entirely?=C2=A0 If no element of B is initialized= in > SUB, well, A has undefined values on return from SUB.=C2=A0 That's how > INTENT(OUT) works. > I think I understand much of what is said, but I feel that I do not really understand what *clobber* means for the different beasts we are discussing (although I have an impression of what it means for a scalar object).