https://gcc.gnu.org/g:9d631a1c6d5e7560bd6b4c4ac4e71aecbc8a9577

commit 9d631a1c6d5e7560bd6b4c4ac4e71aecbc8a9577
Author: Mikael Morin <[email protected]>
Date:   Sun Sep 28 12:34:27 2025 +0200

    Correction régression associate_17.f90

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

diff --git a/gcc/fortran/trans-types.cc b/gcc/fortran/trans-types.cc
index 0095cee07a7b..d2a3af8ce743 100644
--- a/gcc/fortran/trans-types.cc
+++ b/gcc/fortran/trans-types.cc
@@ -2485,8 +2485,13 @@ gfc_sym_type (gfc_symbol * sym, bool is_bind_c)
                                         : GFC_ARRAY_POINTER;
          else if (sym->attr.allocatable)
            akind = GFC_ARRAY_ALLOCATABLE;
+
+         bool contiguous = sym->attr.contiguous
+                           || (sym->assoc
+                               && !sym->assoc->dangling
+                               && !sym->assoc->variable);
          type = gfc_build_array_type (type, sym->as, akind, restricted,
-                                      sym->attr.contiguous, sym->as->corank);
+                                      contiguous, sym->as->corank);
        }
     }
   else

Reply via email to