From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by sourceware.org (Postfix) with ESMTPS id A8E153948438; Thu, 6 Oct 2022 21:07:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A8E153948438 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=1665090455; bh=rx2AuHJcY3Oqx/giDQ0spuSRMY7bYTgycMX1sMRSq2g=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=d3GXDV9DNzRklLTdoICsH3fPsICSSYTQZBDwDdfE4UJMBpfu1yyrRs/M8fPLmpvyG ualKtjzqKJwyljaUM7sWYmYn8VeA03HxlAP+OdOPkxmuOXr7tgrehacvKvnfW4hIS6 sFyjQXpmUW9y25609XOtRHXqGNp8nRALX2Snxzhg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [79.251.13.86] ([79.251.13.86]) by web-mail.gmx.net (3c-app-gmx-bs37.server.lan [172.19.170.89]) (via HTTP); Thu, 6 Oct 2022 23:07:35 +0200 MIME-Version: 1.0 Message-ID: From: Harald Anlauf To: Mikael Morin Cc: gcc-patches , fortran Subject: Aw: Re: [PATCH, v2] Fortran: reject procedures and procedure pointers as IO element [PR107074] Content-Type: text/plain; charset=UTF-8 Date: Thu, 6 Oct 2022 23:07:35 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <6202ba07-98de-b5b4-63bb-4a9a5d76b3b4@orange.fr> References: <3ff755f3-d514-f7cc-f79c-c554b60c2b83@orange.fr> <6202ba07-98de-b5b4-63bb-4a9a5d76b3b4@orange.fr> Content-Transfer-Encoding: quoted-printable X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:VQ9AJKU+vLO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H+eky9 V1N/OPml7iGputcPMiCCTX2A+EGWwX+77E+oSkjPLKnwLkZJ+YfJZEZUq19msiifAq4JpWm+R 1FXX66BZ99t0TWeqroVL4xKpVblP+GrqrRLQ/qQdd547lJIN9aG5ZajfnL+Mw7i0J1eQPKmMT MX1MqcPuNrDTSaA5CzpMN6Q8Z99WQAlhF/kgv2IvvghBWc1w229pesq0grLZ/W5KlcbBNRhnv YX7v6Zk1i2h/LpOK7QmfBGc+Gnk10WCX+0KCZZG6Ra9zlyFt9jXSazcgcgvpL/uky3OJfudXz jNbzLwkHnCXHYNu4oWuSh45LkiIL987BiBsxSO2Zg/W6mH/3Js57iuEtTzv3/6NxQFYgqATZn 12HiP/k9wGAB7XOUiw91QrHaoiHwOyvb4IbSzYBjieHAaJkVz+b8C10cGZt7/q3/K34G6GbqH 5kGcngDBfN3hyyqYdIyVTcnYCm8nQ+5ygNwaf4kFjzLdixH5IOPhBWmoNvL+1bZEqIZQ+wMot XmXB4BOvFCNYRXNJcUI2r8/tyiX9ZgsDhZMceZza75VaZ8Ovc35X4qnepgDODGj33Nma7o3WR NAcx54Zd X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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, I definitely agree that we need a temporary for the result of MERGE(a,a,=2Etrue=2E), I just haven't found out how to do that=2E The reason for the bad one-liner was that in gfc_simplify_merge result =3D gfc_get_parentheses (result); actually does have issues, in that the subsequent gfc_simplify_expr (result, 1); seems to fail in interesting cases (as in PR105371)=2E So that is something to look into=2E=2E=2E Cheers, Harald > Gesendet: Donnerstag, 06=2E Oktober 2022 um 22:32 Uhr > Von: "Mikael Morin" > An: "Harald Anlauf" > Cc: "gcc-patches" , "fortran" > Betreff: Re: [PATCH, v2] Fortran: reject procedures and procedure pointe= rs as IO element [PR107074] > > Le 06/10/2022 =C3=A0 10:37, Mikael Morin a =C3=A9crit=C2=A0: > > Le 05/10/2022 =C3=A0 22:40, Harald Anlauf a =C3=A9crit=C2=A0: > >> Hi Mikael, > >> > >>> Gesendet: Mittwoch, 05=2E Oktober 2022 um 12:34 Uhr > >>> Von: "Mikael Morin" > >>> Please move the check to resolve_transfer in resolve=2Ecc=2E > >> > >> I have done this, see attached updated patch=2E > >> > >> Regtests cleanly on x86_64-pc-linux-gnu=2E > >> > >>> Strangely, the patch doesn't seem to fix the problem on the testcase > >>> here=2E=C2=A0 There is an outer parenthese expression preventing the= condition > >>> you added from triggering=2E=C2=A0 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=2E > >> It is now included=2E > >> > > The rest looks good, but I'm not sure about your one-liner=2E > > I will try to come with a real test later, but in principle, if you ha= ve=20 > > a call to FOO(MERGE(A,A,=2ETRUE=2E)) you can't simplify it to FOO(A) a= s=20 > > writes to the argument in FOO should not overwrite the content of A=2E= The=20 > > dummy should be associated with a temporary value, not to A=2E > >=20 > Here is a test that your patch breaks=2E > Admittedly it's rejected if A has the INTENT(INOUT) attribute, but=20 > without it, I think it's allowed=2E >=20 > program p > integer :: b > b =3D 1 > call foo(merge(b,b,=2Etrue=2E)) > if (b /=3D 1) stop 1 > contains > subroutine foo(a) > integer :: a > if (a =3D=3D 1) a =3D 42 > end subroutine foo > end program p >=20 >