https://gcc.gnu.org/g:b228d5493a71c3afc3a9344d59e0912678b5dd44

commit b228d5493a71c3afc3a9344d59e0912678b5dd44
Author: Mikael Morin <[email protected]>
Date:   Tue Sep 30 17:46:44 2025 +0200

    Correction régression coarray/associate_1.f90

Diff:
---
 gcc/fortran/trans-expr.cc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index c9c9865978a1..9951211a19f8 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -1264,7 +1264,12 @@ gfc_conv_class_to_class (gfc_se *parmse, gfc_expr *e, 
gfc_typespec class_ts,
        gfc_class_array_data_assign (&block, ctree, parmse->expr, false);
     }
   else
-    gfc_copy_descriptor (&block, ctree, parmse->expr);
+    {
+      tree src = parmse->expr;
+      if (GFC_CLASS_TYPE_P (TREE_TYPE (src)))
+       src = gfc_class_data_get (src);
+      gfc_copy_descriptor (&block, ctree, src);
+    }
 
   /* Return the data component, except in the case of scalarized array
      references, where nullification of the cannot occur and so there

Reply via email to