This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33162] INTRINSIC functions as ACTUAL argument
- From: "jaydub66 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Nov 2007 20:53:33 -0000
- Subject: [Bug fortran/33162] INTRINSIC functions as ACTUAL argument
- References: <bug-33162-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #19 from jaydub66 at gmail dot com 2007-11-02 20:53 -------
Hi Jerry,
I tried your patch (part 3b), and noticed that it fails on the following code:
real function t(x)
real ::x
t = x
end function
program p
implicit none
intrinsic sin
procedure(sin):: t
print *,t(1.0)
end program
Seems like this is due to the stuff which you added to decl.c
(match_procedure_decl):
+ if (proc_if != NULL && proc_if->attr.intrinsic
+ && gfc_intrinsic_actual_ok (proc_if->name, 0))
+ goto set_if;
+
if (!sym->attr.pointer && gfc_add_external (&sym->attr, NULL) ==
FAILURE)
return MATCH_ERROR;
if (gfc_add_proc (&sym->attr, sym->name, NULL) == FAILURE)
return MATCH_ERROR;
/* Set interface. */
+set_if:
This prevents the procedure from getting the "external" and "procedure"
attributes, if the interface is an intrinsic routine. This is wrong. A symbol
declared by a PROCEDURE() statement should always get the "procedure"
attribute.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33162