From: Javier Miranda Date: Mon, 24 Jun 2024 11:29:57 +0000 (+0000) Subject: ada: Miscomputed bounds for inner null array aggregates X-Git-Tag: basepoints/gcc-16~6936 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0dbf7285acabc4b61e31adce4ef84320df3d929c;p=thirdparty%2Fgcc.git ada: Miscomputed bounds for inner null array aggregates gcc/ada/ * sem_aggr.adb (Collect_Aggr_Bounds): Adjust previous patch to store the bounds of inner null aggregates in the itype; required generate the runtime check of ARM 4.3.3(30). --- diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index bddfbecf46d..5f7c7321f4f 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -569,10 +569,9 @@ package body Sem_Aggr is end if; -- For null aggregates, build the bounds of their inner dimensions - -- (if not previously done). They are required for building the - -- aggregate itype. + -- since they are required for building the aggregate itype. - elsif No (Aggr_Range (Dim + 1)) then + else declare Loc : constant Source_Ptr := Sloc (N); Typ : constant Entity_Id := Etype (N); @@ -622,7 +621,6 @@ package body Sem_Aggr is Null_Range := Make_Range (Loc, New_Copy_Tree (Lo), Hi); Analyze_And_Resolve (Null_Range, Index_Typ); - pragma Assert (No (Aggr_Range (Num_Dim))); Aggr_Low (Num_Dim) := Low_Bound (Null_Range); Aggr_High (Num_Dim) := High_Bound (Null_Range); Aggr_Range (Num_Dim) := Null_Range;