https://gcc.gnu.org/g:88e247296d234abb9545f02fb4f50cd9a9cf36a4

commit 88e247296d234abb9545f02fb4f50cd9a9cf36a4
Author: Mikael Morin <mik...@gcc.gnu.org>
Date:   Fri May 30 19:40:58 2025 +0200

    Correction régression associated_target_6

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

diff --git a/gcc/fortran/trans-types.cc b/gcc/fortran/trans-types.cc
index 7fe372be4397..a22367fe7e9d 100644
--- a/gcc/fortran/trans-types.cc
+++ b/gcc/fortran/trans-types.cc
@@ -3225,7 +3225,8 @@ gfc_get_derived_type (gfc_symbol * derived, int codimen)
        do_loop = false;
        for (c = derived->components, i = 0; c; c = c->next, i++)
          {
-           if (c->backend_decl)
+           if (fields.length () > i
+               && fields[i] != nullptr)
              continue;
 
            bool same_alloc_type = c->attr.allocatable

Reply via email to