From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 09CED3839838; Sat, 2 Apr 2022 16:49:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 09CED3839838 From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/105138] [7,8,9,10,11,12,F95] Bogus error when function name does not shadow an intrinsic when RESULT clause is used Date: Sat, 02 Apr 2022 16:49:07 +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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: priority everconfirmed bug_status cc target_milestone cf_reconfirmed_on 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2022 16:49:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105138 kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P4 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW CC| |kargl at gcc dot gnu.org Target Milestone|--- |13.0 Last reconfirmed| |2022-04-02 --- Comment #3 from kargl at gcc dot gnu.org --- F2018, 15.6.2.2, page 319 If RESULT appears, the name of the function result of the function is result-name and all occurrences of the function name in execution-part statements in its scope refer to the function itself. If I change COMPLEX to REAL in the first example, I get % gfcx -c -fdump-parse-tree Namespace: A-H: (REAL 4) I-N: (INTEGER 4) O-Z: (REAL 4) procedure name =3D log_gamma symtree: 'log_gamma' || symbol: 'log_gamma'=20=20=20=20 type spec : (REAL 4) attributes: (PROCEDURE INTRINSIC-PROC FUNCTION RECURSIVE) result: res Formal arglist: z symtree: 'res' || symbol: 'res'=20=20=20=20=20=20=20=20=20=20 type spec : (REAL 4) attributes: (VARIABLE RESULT) symtree: 'z' || symbol: 'z'=20=20=20=20=20=20=20=20=20=20=20=20 type spec : (REAL 4) attributes: (VARIABLE DUMMY(IN)) code: ASSIGN log_gamma:res __lgamma_4[[((log_gamma:z))]] The attributes for log_gamma includes INTRINSIC-PROC, which is clearly wrong.=