https://gcc.gnu.org/g:932448b3ecdf3b2d0e9a1e7e9b1c16467a3ccb8a

commit 932448b3ecdf3b2d0e9a1e7e9b1c16467a3ccb8a
Author: Mikael Morin <[email protected]>
Date:   Tue Sep 23 15:36:13 2025 +0200

    Correction régression class_allocate_19.f03

Diff:
---
 gcc/fortran/trans-array.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index 3bf1ab6bd4e8..43d2d9825fc5 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -3805,6 +3805,7 @@ classify_array_ref (tree array, tree ref_base, gfc_expr 
*expr,
     return ARS_CFI_PTR_ARITH;
 
   if (is_pointer_array (array)
+      || (expr && UNLIMITED_POLY (expr))
       || (expr && expr->ts.deferred && array
          && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (array))))
     return ARS_SPANNED_PTR_ARITH;
@@ -3849,6 +3850,7 @@ build_array_ref (gfc_se *se, tree array, tree ref_base, 
gfc_expr *expr,
       {
        tree decl = NULL_TREE;
        if (is_pointer_array (array)
+           || (expr && UNLIMITED_POLY (expr))
            || (expr && expr->ts.deferred && array
                && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (array))))
          {

Reply via email to