This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47352] [F03] ICE with proc-pointers in generic procedures
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 21 Jan 2011 23:01:25 +0000
- Subject: [Bug fortran/47352] [F03] ICE with proc-pointers in generic procedures
- Auto-submitted: auto-generated
- References: <bug-47352-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47352
--- Comment #4 from janus at gcc dot gnu.org 2011-01-21 23:01:23 UTC ---
(In reply to comment #3)
> Simple patch to avoid the ICE:
The patch in comment #3 regtests without problems. However, I'm not sure if
it's the best solution. Here is an alternative:
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 169052)
+++ gcc/fortran/resolve.c (working copy)
@@ -167,6 +167,8 @@ resolve_procedure_interface (gfc_symbol *sym)
sym->attr.function = ifc->attr.function;
sym->attr.subroutine = ifc->attr.subroutine;
gfc_copy_formal_args (sym, ifc);
+ if (sym->attr.function)
+ sym->result = sym;
sym->attr.allocatable = ifc->attr.allocatable;
sym->attr.pointer = ifc->attr.pointer;