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 DCEE03858D20; Mon, 1 Apr 2024 20:04:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DCEE03858D20 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmx.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DCEE03858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=212.227.17.20 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712001896; cv=none; b=ADIAo60N4tuX29+HHNBpAxjl3OHdRmhGbViRCPyZBMytXsb/YCmthIJg3Lnq/Qwnbu9ur/GQYGtFQ2XpRT55AID7Nkdh5lLsjqsr9AZh389Pj/ic2KruHjly93rQK6+1OrOKTlxt4ePkqY565fCr5U8pPA/3S5NlxJbOm+ZDyEE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712001896; c=relaxed/simple; bh=2ys76HKLc5WyXsFL1ZmD975X0x5lhW/ZezZ5cW2ydRc=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=PEWiqK0O1vfjDCh+83+3mLoBGc4QAmD0XxT+OUv2mbxe8IPputILDtNE/hX1yMTUxVUSQvxkCbWoz+Hp82BTs51gwtFTHSbLsvA1rM+v1hC7Sty+5RADXce7UM/2+2lCKOCkz8cdwRonKY8/X6FLpuI+HhKJxqgh8aquHacpQNI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1712001891; x=1712606691; i=anlauf@gmx.de; bh=0zemFJPoBVD1ZAHqWL/rf9Q2RagUmin549J1Jpg62V0=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=n3XqTjPHlClF3gYibVWvsYBCLbznuIS9NXm2ibFqzF6wBUkKysIxEWiVLNjim3cC pWTk6vTfEnUZVRBFmKV7rLyozullGNcITEefrFHAwrqWo88kPiFeS0czu28PVbuQm QAJE8WeijdNGjiagQgWqCAmywupwzo9Q2JpZS9ITEarKRE6rjPoko4qsQ2VS5JQo9 RTUfrcOlnZwi7hXg/g0YCtVbDXA9Nc12WKktcPNb2O6R0v34Am6P9aVELgwbRqp3A MUwi3n9F69/IkCo6zwH2Q0H2CRnHLSnnzjS1wAxjYrR/u3X3jyKHacn10c4hUnpBQ TRSZmTRNL2msWd33yw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.178.29] ([79.251.7.154]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N2mFY-1sq8Nz0nbo-013833; Mon, 01 Apr 2024 22:04:51 +0200 Message-ID: <259997e1-120a-4e40-b04e-8085d68af02b@gmx.de> Date: Mon, 1 Apr 2024 22:04:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [Patch, fortran] PR112407 - [13/14 Regression] Fix for PR37336 triggers an ICE in gfc_format_decoder while constructing a vtab To: Paul Richard Thomas Cc: "fortran@gcc.gnu.org" , gcc-patches , trnka@scm.com Newsgroups: gmane.comp.gcc.patches,gmane.comp.gcc.fortran References: Content-Language: en-US From: Harald Anlauf In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:XNnlZf/RbL1z90iSdv3i/qtUDmvPSoZEhfSIaOdea7fudA+/3EM c4mwpqpTueEQq48bdqLSu3Ylnk5qElJrFXE5xQSfBItq2wus3/H3JMKhZ5G0d7eg66vy0R4 oNZtVlQHim6ZhmsVQdrkIQTpu5BR+VHM0EMBq/NCscx1iYDrBRdtwe41RflxVbxs35a2k0x BtMdaS0nSpRbwTNcsP66Q== UI-OutboundReport: notjunk:1;M01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_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 Paul! Am 31.03.24 um 14:08 schrieb Paul Richard Thomas: > Hi Harald, > >> >> I had only a quick glance at your patch. I guess you unintentionally >> forgot to remove those parts that you already committed for PR110987, >> along with the finalize-testcases. >> > > Guilty as charged. I guess I got out of the wrong side of the bed :-) > >> >> I am still trying to find the precise paragraph in the standard >> you refer to regarding INTENT(OUT) and default initialization. >> > > Page 114 of the draft F2023 standard: > "The INTENT (OUT) attribute for a nonpointer dummy argument specifies th= at > the dummy argument becomes undefined on invocation of the procedure, exc= ept > for any subcomponents that are default-initialized (7.5.4.6)." > With the fix, gfortran behaves in the same way as ifort and nagfor. > > On rereading the patch, I think that s/"and use the passed value"/"and > leave undefined"/ or some such is in order. Yes, something along this line is better. I also did test with NAG and Intel, and was surprised (confused?) at how the count of finalizer calls changes if component "i" gets a default value or not. Something one wouldn't do right after getting out of bed! So the patch looks good to me - except for one philosophical question: Fortran 2018 makes procedures recursive by default, but this is not yet implemented as such, and NON_RECURSIVE is not yet implemented. The new testcase pr112407b.f90 compiles with nagfor -f2018 without any warnings, and gives an error with nagfor -f2008. It appears that it works in the testsuite after the patch and when adding "-std=3Df2008" instead of using the default "-std=3Dgnu". Would you mind adding "-std=3Df2008" as dg-option to that testcase? This would avoid one bogus regression when gfortran moves forward. Thanks for the patch! Harald > >> While at it, I think I found a minor nit in testcase pr112407a.f90: >> component x%i appears undefined the first time it is printed. >> > > Fixed - thanks for pointing it out. > > A correct patch is attached. > > Thanks for looking at the previous, overloaded version. > > Paul > > > >> >>> 2024-03-30 Paul Thomas >>> >>> gcc/fortran >>> PR fortran/112407 >>> *resolve.cc (resolve_procedure_expression): Change the test for >>> for recursion in the case of hidden procedures from modules. >>> (resolve_typebound_static): Add warning for possible recursive >>> calls to typebound procedures. >>> * trans-expr.cc (gfc_trans_class_init_assign): Do not apply >>> default initializer to class dummy where component initializers >>> are all null. >>> >>> gcc/testsuite/ >>> PR fortran/112407 >>> * gfortran.dg/pr112407a.f90: New test. >>> * gfortran.dg/pr112407b.f90: New test. >>> >> >> >