From: Marc Poulhiès Date: Mon, 22 Sep 2025 08:57:13 +0000 (+0200) Subject: ada: Fix handling of Extended_Access with array subtype X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8de9c3b0e92a07b9cfac6d33fd58362fe0a1786e;p=thirdparty%2Fgcc.git 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 --- 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