From b64aaf4d81916f5570ddf2414747f3152e8b9f84 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Sun, 19 Feb 2023 18:45:00 +0100 Subject: ada: Remove the body of System.Storage_Elements All the subprograms declared in the unit have convention Intrinsic and their current implementation makes some implicit assumptions that are not valid universally, so it is replaced by a direct expansion. This is mostly straightforward because Resolve_Intrinsic_Operator already contains the required circuitry, but a few adjustements are necessary. gcc/ada/ * exp_ch4.adb (Expand_N_Op_Mod): Deal with the special mod operator of System.Storage_Elements. * exp_intr.adb (Expand_To_Integer): New procedure. (Expand_Intrinsic_Call): Call Expand_To_Integer appropriately. (Expand_To_Address): Deal with an argument with modular type. * sem_ch3.adb (Derive_Subprogram): Also set convention Intrinsic on a derived intrinsic subprogram. * sem_res.adb (Resolve_Arithmetic_Op): Deal with intrinsic operators not coming from source exactly as those coming from source and also generate a reference in both cases. (Resolve_Op_Expon): Likewise. (Resolve_Intrinsic_Operator): Call Implementation_Base_Type to get a nonprivate base type. * snames.ads-tmpl (Name_To_Integer): New intrinsic name. * libgnat/s-stoele.ads: Replace pragma Convention with pragma Import throughout and remove pragma Inline_Always and Pure_Function. * libgnat/s-stoele.adb: Replace entire contents with pragma No_Body. * libgnat/s-atacco.adb: Adjust comment about pragma No_Body. --- gcc/ada/sem_ch3.adb | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/ada/sem_ch3.adb') diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index bace2cf..50ccb39 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -16206,6 +16206,7 @@ package body Sem_Ch3 is if No (Actual_Subp) then if Is_Intrinsic_Subprogram (Parent_Subp) then + Set_Convention (New_Subp, Convention_Intrinsic); Set_Is_Intrinsic_Subprogram (New_Subp); if Present (Alias (Parent_Subp)) -- cgit v1.1