]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix handling of Extended_Access with array subtype
authorMarc Poulhiès <poulhies@adacore.com>
Mon, 22 Sep 2025 08:57:13 +0000 (10:57 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 6 Oct 2025 12:27:10 +0000 (14:27 +0200)
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 <botcazou@adacore.com>
gcc/ada/gcc-interface/decl.cc

index 9ade3fd8c4e9719b9f85a294e9504b6f63923ac2..7ebd432119530441ebc64df3145f8dea55e33c08 100644 (file)
@@ -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