This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/47352] [F03] ICE with proc-pointers in generic procedures


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]