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 A56543858423 for ; Sat, 2 Oct 2021 19:19:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A56543858423 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mWkXS-0004jO-O3 for gcc-patches@gcc.gnu.org; Sat, 02 Oct 2021 21:19:14 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gcc-patches@gcc.gnu.org From: Harald Anlauf Subject: Re: [Patch] Fortran: Avoid var initialization in interfaces [PR54753] Date: Sat, 2 Oct 2021 21:19:05 +0200 Message-ID: References: <40ee9c33-3122-54aa-a43b-655bb280b7fc@codesourcery.com> <0131e2d5-be68-d3b1-b90f-6640c358e1ab@codesourcery.com> 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:78.0) Gecko/20100101 Thunderbird/78.12.0 In-Reply-To: Content-Language: en-US Cc: fortran@gcc.gnu.org X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00, FORGED_MUA_MOZILLA, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2021 19:19:18 -0000 Hi Tobias, Am 02.10.21 um 20:29 schrieb Tobias Burnus: > On 02.10.21 20:01, Sandra Loosemore wrote: >> On 9/29/21 2:53 AM, Tobias Burnus wrote: >>> There are three issues, this patch solves the first: >>> * reject-valid issue due to adding the initializer also to a dummy >>>    argument which is in an INTERFACE block. Having initializers in >>>    INTERFACE blocks is pointless and causes for the attached testcase >>    the bogus error: >>>    "Assumed-rank variable y at (1) may only be used as actual argument" >>> ... >> This has indeed allowed me to make progress on adding the diagnostic, >> but I'm seeing some test regressions on x86_64-linux-gnu that are due >> to this patch alone: >> >> FAIL: gfortran.dg/default_initialization_3.f90   -O0  execution test > > I do not see this error. Can you double check that you indeed use the > posted patch: > > https://gcc.gnu.org/pipermail/gcc-patches/2021-September/580483.html – > and nothing else, e.g., an earlier draft? Sandra is right. Actually I do see that regression, too. The default initialization is missing in F1, see dump-tree: __attribute__((fn spec (". R w w "))) integer(kind=4) master.0.f1 (integer(kind=8) __entry, struct t1 * d2, struct t1 * d1) { integer(kind=4) res; integer(kind=4) __result_master.0.f1; integer(kind=4) res.0 [value-expr: __result_master.0.f1]; if (d1 != 0B) { { struct t1 t1.1; t1.1.i = 7; *d1 = t1.1; } } The latter "if (d1 != 0B)" block gets removed by your change, and this is not good. > (I still have to commit it; it was approved by Harald, but he also he > preferred to have a second view, I decided to wait until tomorrow/Monday > before committing it.) Well, I did not regtest, only read the patch and trust that you did your homework! > Tobias Harald