https://gcc.gnu.org/g:8de9c3b0e92a07b9cfac6d33fd58362fe0a1786e

commit r16-4247-g8de9c3b0e92a07b9cfac6d33fd58362fe0a1786e
Author: Marc Poulhiès <[email protected]>
Date:   Mon Sep 22 10:57:13 2025 +0200

    ada: Fix handling of Extended_Access with array subtype
    
    For array subtypes, return the extended types corresponding to the array
    type.
    
    gcc/ada/ChangeLog:
    
            * gcc-interface/decl.cc (get_extended_unconstrained_array): Handle
            array subtype.
    
    Co-authored-by: Éric Botcazou <[email protected]>

Diff:
---
 gcc/ada/gcc-interface/decl.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index 9ade3fd8c4e9..7ebd43211953 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -5310,6 +5310,10 @@ get_extended_unconstrained_array (Entity_Id gnat_entity, 
tree gnu_type)
   gcc_assert (Is_Array_Type (gnat_entity)
              && TREE_CODE (gnu_type) == UNCONSTRAINED_ARRAY_TYPE);
 
+
+  if (Ekind (gnat_entity) == E_Array_Subtype)
+    return get_extended_unconstrained_array (Etype (gnat_entity), gnu_type);
+
   tree gnu_extended_type = TYPE_EXTENDED_UNCONSTRAINED_ARRAY (gnu_type);
 
   /* Building the extended type is achieved by translating the array type

Reply via email to