From 8de9c3b0e92a07b9cfac6d33fd58362fe0a1786e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20Poulhi=C3=A8s?= Date: Mon, 22 Sep 2025 10:57:13 +0200 Subject: [PATCH] ada: Fix handling of Extended_Access with array subtype MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- 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 9ade3fd8c4e..7ebd4321195 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 -- 2.47.3