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

--- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
This simple (too simple?) patch seems to fix things:

Index: trans-expr.c
===================================================================
--- trans-expr.c        (Revision 268992)
+++ trans-expr.c        (Arbeitskopie)
@@ -4944,7 +4944,12 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc

   if (e->rank != 0)
     {
-      gfc_conv_expr_descriptor (parmse, e);
+      if (fsym->attr.contiguous
+         && !gfc_is_simply_contiguous (e, false, true))
+       gfc_conv_subref_array_arg (parmse, e, false, fsym->attr.intent,
+                                  fsym->attr.pointer);
+      else
+       gfc_conv_expr_descriptor (parmse, e);

       if (POINTER_TYPE_P (TREE_TYPE (parmse->expr)))
        parmse->expr = build_fold_indirect_ref_loc (input_location,

Reply via email to