https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124265
--- Comment #3 from Liam Powell <liam at liampwll dot com> ---
Below patch fixes this, however a few more assertion failures can be observed
by applying my changes in PR ada/124201. Once that's fixed properly this may
need a rework.
modified gcc/ada/sem_dim.adb
@@ -1902,9 +1902,6 @@ package body Sem_Dim is
-- thing that is done in Analyze_Dimension_Subtype_Declaration for
-- explicit declarations.
- -- Does Dims_Of_Etyp ever exist for itypes???
- pragma Assert (not Exists (Dims_Of_Etyp));
-
if Is_Itype (Etyp)
and then
Nkind (Subtype_Indication (Component_Definition (N)))
@@ -1914,6 +1911,9 @@ package body Sem_Dim is
Subt_Indic : constant Node_Id :=
Subtype_Indication (Component_Definition (N));
begin
+ -- Does Dims_Of_Etyp ever exist for itypes???
+ pragma Assert (not Exists (Dims_Of_Etyp));
+
Dims_Of_Etyp := Dimensions_Of (Etype (Subtype_Mark (Subt_Indic)));
if Exists (Dims_Of_Etyp) then