[Bug fortran/71612] [Coarray] Wrongly rejects coindexed variables in READ

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jun 21 19:13:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71612

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Something like the following is needed; the first part should be fine
(untested) and be sufficient for compiling the code, but the FIXME is required
to get it actually working ...

diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 4378313..950f5a2 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -8645,4 +8645,19 @@ resolve_transfer (gfc_code *code)
-  if (code->ext.dt && code->ext.dt->dt_io_kind->value.iokind == M_READ
-      && !gfc_check_vardef_context (exp, false, false, false,
-                                   _("item in READ")))
-    return;
+  if (code->ext.dt && code->ext.dt->dt_io_kind->value.iokind == M_READ)
+    {
+      bool coindexed = false;
+      if (exp->expr_type == EXPR_FUNCTION
+         && exp->value.function.isym
+         && exp->value.function.isym->id == GFC_ISYM_CAF_GET)
+       {
+         coindexed = true;
+         remove_caf_get_intrinsic (exp);
+       }
+
+      if (!gfc_check_vardef_context (exp, false, false, false,
+                                    _("item in READ")))
+       return;
+      if (coindexed)
+       {
+// FIXME: Add temporary - and send it via GFC_ISYM_CAF_SEND
+       }
+    }


More information about the Gcc-bugs mailing list