------- Comment #8 from janus at gcc dot gnu dot org  2009-06-22 09:04 -------

> pr39850.f90:12:0: internal compiler error: in gfc_typenode_for_spec, at
> fortran/trans-types.c:995

Yeah, the same happens for the examples in PR37254. I didn't notice it before,
since I changed the test case slightly in my commit. Here is a patch which
fixes it:

Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c     (revision 148778)
+++ gcc/fortran/interface.c     (working copy)
@@ -1407,9 +1407,14 @@
        }

       if (formal->attr.function && !act_sym->attr.function)
-       gfc_add_function (&act_sym->attr, act_sym->name,
&act_sym->declared_at);
-
-      if (formal->attr.subroutine && !act_sym->attr.subroutine)
+       {
+         gfc_add_function (&act_sym->attr, act_sym->name,
+         &act_sym->declared_at);
+         if (act_sym->ts.type == BT_UNKNOWN
+             && gfc_set_default_type (act_sym, 1, act_sym->ns) == FAILURE)
+           return 0;
+       }
+      else if (formal->attr.subroutine && !act_sym->attr.subroutine)
        gfc_add_subroutine (&act_sym->attr, act_sym->name,
                            &act_sym->declared_at);


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39850

Reply via email to