From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CFE51384B13A; Thu, 27 Oct 2022 19:49:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CFE51384B13A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666900178; bh=ZB/e+qrRk4ShGo677vebHSA/fehzHXrlmYqrIYLpChE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Y/invFLu3u4CBpCPtsRTMpiQD8Oob0hxWZaILturpSocDhL//nGHvFpCsssOcH0dI ADHzq/lWe94qKmKZdx2X7u8FgN/+RVQ7rpHb2EMCdBfssdEsXDVg4r+nLQAmGcJPtG ltLktk61EYuEpVQcyMWnYYzouKdeo3o+CPUM9W/A= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/107441] optional arguments are identified as "present" when missing Date: Thu, 27 Oct 2022 19:49:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107441 --- Comment #5 from anlauf at gcc dot gnu.org --- (In reply to anlauf from comment #4) > Is there a public documentation what the ordering should be? It is actually documented for gfortran: https://gcc.gnu.org/onlinedocs/gfortran/Argument-passing-conventions.html The arguments are passed in the following order * Result variable, when the function result is passed by reference * Character length of the function result, if it is a of type CHARACTER and= no C binding is used * The arguments in the order in which they appear in the Fortran declaration * The present status for optional arguments with value attribute, which are internally passed by value * The character length and/or coarray token and offset for the first argume= nt which is a CHARACTER or a nonallocatable coarray dummy argument, followed by the hidden arguments of the next dummy argument of such a type=20 So it is create_function_arglist which is broken.=