From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 753E23894426; Wed, 17 Feb 2021 09:19:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 753E23894426 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Tobias_Burnus@mentor.com IronPort-SDR: H7eSCXrWXTOGtp5zx9+GjZzeBINqM4Zaje/vyg0PQpIRnEsOiYd+KmvtN9caIdCJUZQapY59LR 8gFW1CoAM2Jo8p/AV4NJoyzhWMz6Kmcz9/cR6tMHvsUCMQEMYgE7dz6BSsakc7wd+4gFpZQnrq Xco18QmuawqNQX1rwS5MeflvtuujMamaFDHbKIT700XrP4+i8f77nAB8/wR5IRpY1ZZSkHf/2O XZQilspPEIcIV5WqJTY2F9rbp79ameWDMMznW6dzUm+ahRiCTIHfRnnUIT8dlgJFbpgr8T6B2R hew= X-IronPort-AV: E=Sophos;i="5.81,184,1610438400"; d="scan'208";a="60507811" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 17 Feb 2021 01:19:31 -0800 IronPort-SDR: LrqHpnEGaXx9xngrd+z6fQpcGhRkhPx83JQd7DfaqJsJcLP8VORnZYVpWEmB5JeJRGnJS5/2Ly 1EMwBHOXToZQJyu10ebwqjlXGLoU2YX+g654yAdBNzV4cgNoeJs4mUbJVSweCJsJ4E/Wnq1y76 UoUZLoWeBaiNA2W8vmsS+k8Ub8Ze8qYC1g2nbuJCaP/aeN7d8fGM+vZzGWRpJ58r4+Y1KH2TfF 56ltNC0JIFZQD7Zj8qObopXRewE19Lv60KclOz2Hh5m+FCUsKsFfOSTEoPE+Qh8y/jpsOJLr39 sqE= Subject: Re: [patch, fortran] PR96686 Namelist group objects shall be defined before appearing in namelist To: Jerry DeLisle , gfortran CC: gcc-patches References: <61fc2d13-04fc-0262-578a-b3f48d130589@charter.net> From: Tobias Burnus Message-ID: <4ae5418a-a51d-23a4-12fe-81342bd6f7d2@codesourcery.com> Date: Wed, 17 Feb 2021 10:19:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <61fc2d13-04fc-0262-578a-b3f48d130589@charter.net> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-06.mgc.mentorg.com (139.181.222.6) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2021 09:19:35 -0000 Hi Jerry, I note that you have not written that testcase and I am still half aspleep, but I fail to see what's wrong with the following program (before and after your change): f2 looks like a local and implicitly typed real variable. At least ifort compiles this program successfully. F2018 has: "A namelist group object shall either be accessed by use or host association or shall have its declared type, kind type parameters of the declared type, and rank specified by previous specification statements or the procedure heading in the same scoping unit or by the implicit typing rules in effect for the scoping unit. If a namelist group object is typed by the implicit typing rules, its appearance in any subsequent type declaration statement shall confirm the implied type and type parameters." Tobias On 17.02.21 04:02, Jerry DeLisle wrote: > index 538bceaa4b6..4e021253f01 100644 > --- a/gcc/testsuite/gfortran.dg/namelist_4.f90 > +++ b/gcc/testsuite/gfortran.dg/namelist_4.f90 > @@ -27,14 +27,14 @@ END module M1 > program P1 > CONTAINS > ! This has the additional wrinkle of a reference to the object. > + INTEGER FUNCTION F2() > + F2=3D1 > + END FUNCTION > INTEGER FUNCTION F1() > NAMELIST /NML3/ F2 ! { dg-error "PROCEDURE attribute conflicts" } > ! Used to ICE here > - f2 =3D 1 ! { dg-error "is not a VALUE" } > + f2 =3D 1 ! { dg-error "is not a variable" } > F1=3D1 > END FUNCTION > - INTEGER FUNCTION F2() > - F2=3D1 > - END FUNCTION > END ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 M=C3=BCnchen R= egistergericht M=C3=BCnchen HRB 106955, Gesch=C3=A4ftsf=C3=BChrer: Thomas H= eurung, Frank Th=C3=BCrauf