https://gcc.gnu.org/g:c4dc5124872bc3d261fdc6d3f0f7e86976f495e5
commit r16-1372-gc4dc5124872bc3d261fdc6d3f0f7e86976f495e5 Author: Ronan Desplanques <desplanq...@adacore.com> Date: Fri Mar 21 16:49:20 2025 +0100 ada: Simplify Constrain_Array Before this patch, Constrain_Array had a feature where it could be passed Empty for the first actual and would then create an Itype itself. There was only one use of this feature and it was unnecessary, so this patch removes it. gcc/ada/ChangeLog: * sem_ch3.adb (Constrain_Array): Simplify. (Process_Subtype): Adjust. Diff: --- gcc/ada/sem_ch3.adb | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 823cc34e22b6..45f7dc90aa45 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -382,7 +382,7 @@ package body Sem_Ch3 is -- created in the procedure and attached to Related_Nod. procedure Constrain_Array - (Def_Id : in out Entity_Id; + (Def_Id : Entity_Id; SI : Node_Id; Related_Nod : Node_Id; Related_Id : Entity_Id; @@ -13980,7 +13980,7 @@ package body Sem_Ch3 is --------------------- procedure Constrain_Array - (Def_Id : in out Entity_Id; + (Def_Id : Entity_Id; SI : Node_Id; Related_Nod : Node_Id; Related_Id : Entity_Id; @@ -14080,14 +14080,7 @@ package body Sem_Ch3 is end if; end if; - if No (Def_Id) then - Def_Id := - Create_Itype (E_Array_Subtype, Related_Nod, Related_Id, Suffix); - Set_Parent (Def_Id, Related_Nod); - - else - Mutate_Ekind (Def_Id, E_Array_Subtype); - end if; + Mutate_Ekind (Def_Id, E_Array_Subtype); Set_Size_Info (Def_Id, (T)); Set_First_Rep_Item (Def_Id, First_Rep_Item (T)); @@ -22664,8 +22657,7 @@ package body Sem_Ch3 is -- has not yet been called to create Def_Id. else - if Is_Array_Type (Subtype_Mark_Id) - or else Is_Concurrent_Type (Subtype_Mark_Id) + if Is_Concurrent_Type (Subtype_Mark_Id) or else Is_Access_Type (Subtype_Mark_Id) then Def_Id := Empty;