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

--- Comment #2 from anlauf at gcc dot gnu.org ---
The associate-var is missing the contiguous attribute.

Untested fix:

diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index b1d2ff220bf..6ac90b23fd7 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -10790,6 +10826,10 @@ resolve_assoc_var (gfc_symbol* sym, bool
resolve_target)
   /* If the target is a good class object, so is the associate variable.  */
   if (sym->ts.type == BT_CLASS && gfc_expr_attr (target).class_ok)
     sym->attr.class_ok = 1;
+
+  /* If the target is a contiuous pointer, so is the associate variable.  */
+  if (gfc_expr_attr (target).pointer && gfc_expr_attr (target).contiguous)
+    sym->attr.contiguous = 1;
 }

Reply via email to