check.c (is_coarray): Remove.
authorMikael Morin <mikael.morin@sfr.fr>
Fri, 7 Oct 2011 19:02:36 +0000 (21:02 +0200)
committerMikael Morin <mikael@gcc.gnu.org>
Fri, 7 Oct 2011 19:02:36 +0000 (19:02 +0000)
* check.c (is_coarray): Remove.
(coarray_check): Use gfc_is_coarray.

From-SVN: r179671

gcc/fortran/ChangeLog
gcc/fortran/check.c

index f5fc071f7e419ddd304a56562d0e0b06b75d82e9..d1a90144918e435c081230e54640d7eeaa777e28 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
+
+       * check.c (is_coarray): Remove.
+       (coarray_check): Use gfc_is_coarray.
+
 2011-10-07  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/50625
index b1fc38accb819cded1699844ebbdb3cf958652c8..9b8ec21a7636678774b53bc4ed5a3b25dbd706f9 100644 (file)
@@ -203,42 +203,10 @@ double_check (gfc_expr *d, int n)
 }
 
 
-/* Check whether an expression is a coarray (without array designator).  */
-
-static bool
-is_coarray (gfc_expr *e)
-{
-  bool coarray = false;
-  gfc_ref *ref;
-
-  if (e->expr_type != EXPR_VARIABLE)
-    return false;
-
-  coarray = e->symtree->n.sym->attr.codimension;
-
-  for (ref = e->ref; ref; ref = ref->next)
-    {
-      if (ref->type == REF_COMPONENT)
-       coarray = ref->u.c.component->attr.codimension;
-      else if (ref->type != REF_ARRAY || ref->u.ar.dimen != 0)
-       coarray = false;
-      else if (ref->type == REF_ARRAY && ref->u.ar.codimen != 0) 
-       {
-         int n;
-         for (n = 0; n < ref->u.ar.codimen; n++)
-           if (ref->u.ar.dimen_type[n] != DIMEN_THIS_IMAGE)
-             coarray = false;
-       }
-    }
-
-  return coarray;
-}
-
-
 static gfc_try
 coarray_check (gfc_expr *e, int n)
 {
-  if (!is_coarray (e))
+  if (!gfc_is_coarray (e))
     {
       gfc_error ("Expected coarray variable as '%s' argument to the %s "
                  "intrinsic at %L", gfc_current_intrinsic_arg[n]->name,