From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp-20.smtpout.orange.fr [80.12.242.20]) by sourceware.org (Postfix) with ESMTPS id 712E43858D37 for ; Thu, 6 Oct 2022 20:32:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 712E43858D37 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 gXXWonmv4nj75gXXmoUKEN; Thu, 06 Oct 2022 22:32:35 +0200 X-ME-Helo: [192.168.1.17] X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Thu, 06 Oct 2022 22:32:35 +0200 X-ME-IP: 86.215.174.255 Message-ID: <6202ba07-98de-b5b4-63bb-4a9a5d76b3b4@orange.fr> Date: Thu, 6 Oct 2022 22:32:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH, v2] Fortran: reject procedures and procedure pointers as IO element [PR107074] Content-Language: fr, en-US From: Mikael Morin To: Harald Anlauf Cc: gcc-patches , fortran References: <3ff755f3-d514-f7cc-f79c-c554b60c2b83@orange.fr> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.6 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_PASS,SPF_PASS,TXREP autolearn=unavailable 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 06/10/2022 à 10:37, Mikael Morin a écrit : > Le 05/10/2022 à 22:40, Harald Anlauf a écrit : >> Hi Mikael, >> >>> Gesendet: Mittwoch, 05. Oktober 2022 um 12:34 Uhr >>> Von: "Mikael Morin" >>> Please move the check to resolve_transfer in resolve.cc. >> >> I have done this, see attached updated patch. >> >> Regtests cleanly on x86_64-pc-linux-gnu. >> >>> Strangely, the patch doesn't seem to fix the problem on the testcase >>> here.  There is an outer parenthese expression preventing the condition >>> you added from triggering.  Can you double check? >> >> You are right: I had a one-liner in my worktree from PR105371 that >> fixes an issue with gfc_simplify_merge and that seems to help here. >> It is now included. >> > The rest looks good, but I'm not sure about your one-liner. > I will try to come with a real test later, but in principle, if you have > a call to FOO(MERGE(A,A,.TRUE.)) you can't simplify it to FOO(A) as > writes to the argument in FOO should not overwrite the content of A. The > dummy should be associated with a temporary value, not to A. > Here is a test that your patch breaks. Admittedly it's rejected if A has the INTENT(INOUT) attribute, but without it, I think it's allowed. program p integer :: b b = 1 call foo(merge(b,b,.true.)) if (b /= 1) stop 1 contains subroutine foo(a) integer :: a if (a == 1) a = 42 end subroutine foo end program p