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

--- Comment #2 from janus at gcc dot gnu.org 2011-02-07 21:05:04 UTC ---
The patch in comment #1 produces a couple of regressions. The following should
take care of most of them:

Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c    (revision 169891)
+++ gcc/fortran/interface.c    (working copy)
@@ -1887,7 +1887,7 @@ get_expr_storage_size (gfc_expr *e)
       else if (ref->type == REF_ARRAY && ref->u.ar.type == AR_ELEMENT
            && e->expr_type == EXPR_VARIABLE)
     {
-      if (e->symtree->n.sym->as->type == AS_ASSUMED_SHAPE
+      if (ref->u.ar.as->type == AS_ASSUMED_SHAPE
           || e->symtree->n.sym->attr.pointer)
         {
           elements = 1;
@@ -1916,8 +1916,6 @@ get_expr_storage_size (gfc_expr *e)
             - mpz_get_si (ref->u.ar.as->lower[i]->value.integer));
         }
         }
-      else
-    return 0;
     }

   if (substrlen)
@@ -2107,9 +2105,9 @@ compare_actual_formal (gfc_actual_arglist **ap, gf

       actual_size = get_expr_storage_size (a->expr);
       formal_size = get_sym_storage_size (f->sym);
-      if (actual_size != 0
-        && actual_size < formal_size
-        && a->expr->ts.type != BT_PROCEDURE)
+      if (actual_size != 0 && actual_size < formal_size
+      && a->expr->ts.type != BT_PROCEDURE
+      && f->sym->attr.flavor != FL_PROCEDURE)
     {
       if (a->expr->ts.type == BT_CHARACTER && !f->sym->as && where)
         gfc_warning ("Character length of actual argument shorter "

Reply via email to