From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by sourceware.org (Postfix) with ESMTPS id DC3463858295; Wed, 2 Nov 2022 21:19:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DC3463858295 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.de; s=s31663417; t=1667423968; bh=3oAD4+Y1Jsdgftv0pyq1YyeU8KtztJdfkBE+ShHUWLA=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=f4WDeSnuWZIha9/BHPdkuWWlwvhr0h4TPs3f6w60idjS6x3rOr5XsPzH4MwtDfth3 b28Vi9tWszDCVRC6PTpuFfKJsuKg1hcgmvbUF1/UmkRm9Ni6Mt9551ZyRmpHJVL/0w yCUEYc58MJygpbRdl1a7/AzOJ+2UPTTlt0oMrNCv73Ejq+/KwolmwFEuToyg1sILiF 1wRdktyGzGxAV+VZ0+t6Hlo4tQtttzPKbYZepZSyVKF9/yI/knePgllXOd3tQLmJg/ 3Td4AaXfwiOXJqGTkMae76iM9ssH3YvdU8SDAiQSiRS/gJJRuDcbqhK6hGXcvHj2dm wG0RaEvcyVCzg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.178.29] ([93.207.83.190]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M3DNt-1otu3B2Jif-003akD; Wed, 02 Nov 2022 22:19:28 +0100 Message-ID: <8725411a-979b-dd53-d1fe-5b041482a8eb@gmx.de> Date: Wed, 2 Nov 2022 22:19:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH, v2] Fortran: ordering of hidden procedure arguments [PR107441] To: Mikael Morin , fortran@gcc.gnu.org Cc: gcc-patches@gcc.gnu.org Newsgroups: gmane.comp.gcc.fortran,gmane.comp.gcc.patches References: <7d8ddf07-e66d-2678-de99-0e575c70ea17@orange.fr> <327319ac-4ef9-1e48-e993-57113d802d3b@orange.fr> <85a5951a-7ea4-57b3-895a-ff7dbf1ef92e@orange.fr> <93a5f029-4411-3424-f6ee-3b2bcf210050@gmx.de> 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:NfmRy6ct0R6SqRbL1OLPIXpFp9h2KkoVPLAzUs9TExn5CSHrLHI BnKVuhO3w5TPLmp/BsmtMkCANXCArSvB7w8fdxm8nPJp5KJnCRdvWI8YhcLiS5SWInTfd9R /33VVx9WbF22wd2nsIgONC5mo1eBJ/zcV47K+JC18ZFXuMY4C9fJEL0QdAoQ7wQ1GyctHnV +w0IRWjB9yuQnMmzkSlpg== UI-OutboundReport: notjunk:1;M01:P0:pQb6O6/oGkw=;QKUVbSlCRkP5RIwXAblUZF+tynr G3OQOqGvdjusifr0AU7BLnyl0cw3CaU5nTBEauVHHRp8a2xaDxGGVPqtSNOuqs7pRMOb5DchD 15N5mx73H3djkgU+JtbfVbjYiFePoS5wOXdUUEUTOzif14GgWCOQQWPE3Thcomv36xNpgqZRw HhUTU9Rp9dwTbunXKRsLJkc1ML3MzEzMe/uPSs8tFYO3Dop+dWcuRhOujvqEsOX0owUOoxqRT GJ5M8FLTjD/Yad1IuztHXR1oUQcoKhfMjorPnT/Xp9q6xJqcHW+YuyRaB0XHdFa2CeQoPXCQ2 LdnHOC9Y7UCXGFDhAQXGcb93OvD0ttLm9ny6fok9yvmn7p7PR7rftallwweEneiIOYyqE1G4N G+MCYUAmAA/N+CKr6Q3cetEoE1Zvz4oIAXiKg/UIcIie7MUrOClBgj09lbt8MhYgvxtz4bXq5 Vy8zvkmOm2cFzhC7ajFw2CqP5QK1DbPfsO7ncNa/FuelWmkwwtll5vgfjvGnBuvx2bqI7tAJp GZP+jsxjbA9W8YA0tMUfdPjTRINcaqzulBBEGotraiFOL8Np+MqygAIhtzhPmONpuNqPecUAa b8ygOT19xhKylrKWoO1ckX753ijLY8nixHk2FxUtggsUCTyuy94DNv24hE02ess2CRCTOiGcH wkICwZIAALajpmEtEPCEQ5CB6vc8TIjgsBEN2fp6NcNE3fudpDo/LKEZO8xHcmgSgCLXZh2/m rylOimw7gv/HsLeH+/BgERjQG2wEPfo1A2WWCLnyHBxshCJvyrot/eJwy5NZX/8YiKeIJYSIn Q65R6a/UFYzgBbmGtcIwRfnt3BV7utaS7O3Y+CuoS91TiXDu1GS5wwOY1s2DoNdqpi/VzALmU SSLjXyLPDkFZ77vdbgzwhmkZ0YDUiUAW76Zp8+n6zAqYgu6FFnZqCfzq3UL4znDO62+zR5u2F Dqlplg== X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Am 02.11.22 um 18:20 schrieb Mikael Morin: > Unfortunately no, the coarray case works, but the other problem remains. > The type problem is not visible in the definition of S, it is in the > declaration of S's prototype in P. > > S is defined as: > > void s (character(kind=3D1)[1:_c] & restrict c, integer(kind=3D4) o, > logical(kind=3D1) _o, integer(kind=3D8) _c) > { > ... > } > > but P has: > > void p () > { > =C2=A0 static void s (character(kind=3D1)[1:] & restrict, integer(kind= =3D4), > integer(kind=3D8), logical(kind=3D1)); > =C2=A0 void (*) (character(kind=3D1)[1:] & restrict, integer(kind= =3D4), > integer(kind=3D8), logical(kind=3D1)) pp; > > =C2=A0 pp =3D s; > ... > } Right, now I see it too. Simplified case: program p call s ("abcd") contains subroutine s(c, o) character(*) :: c integer, optional, value :: o end subroutine s end I do see what needs to be done in gfc_get_function_type, which seems in fact very simple. But I get really lost in create_function_arglist when trying to get the typelist right. One thing is I really don't understand how the (hidden_)typelist is managed here. How does that macro TREE_CHAIN work? Can we somehow chain two typelists the same way we chain arguments? (Failing that, I tried to split the loop over the dummy arguments in create_function_arglist into two passes, one for the optional+value variant, and one for the rest. It turned out to be a bad idea...) Harald