https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105138
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 = log_gamma
symtree: 'log_gamma' || symbol: 'log_gamma'
type spec : (REAL 4)
attributes: (PROCEDURE INTRINSIC-PROC FUNCTION RECURSIVE)
result: res
Formal arglist: z
symtree: 'res' || symbol: 'res'
type spec : (REAL 4)
attributes: (VARIABLE RESULT)
symtree: 'z' || symbol: 'z'
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.