diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-04-24 17:13:34 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2024-06-13 15:30:30 +0200 |
commit | 8d310d8ad89ca32cebe22ec9bac3980237db4e12 (patch) | |
tree | 0c4ac71a051038af2ee1571ec82ddacfb1f1b738 /gcc/ada/rtsfind.adb | |
parent | df9d6153e1981676b08109fbe3371ca6e9d5f755 (diff) | |
download | gcc-8d310d8ad89ca32cebe22ec9bac3980237db4e12.zip gcc-8d310d8ad89ca32cebe22ec9bac3980237db4e12.tar.gz gcc-8d310d8ad89ca32cebe22ec9bac3980237db4e12.tar.bz2 |
ada: Streamline elaboration of local tagged types
This set of changes is aimed at streamlining the code generated for the
elaboration of local tagged types. The dispatch tables and other related
data structures are built dynamically on the stack for them and a few of
the patterns used for this turn out to be problematic for the optimizer:
1. the array of primitives in the dispatch table is default-initialized to
null values by calling the initialization routine of an unconstrained
array type, and then immediately assigned an aggregate made up of the
same null values.
2. the external tag is initialized by means of a dynamic concatenation
involving the secondary stack, but all the elements have a fixed size.
3. the _size primitive is saved in the TSD by means of the dereference of
the address of the TSD that was previously saved in the dispatch table.
gcc/ada/
* Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-imad32$(objext),
s-imad64$(objext) and s-imagea$(objext).
* exp_atag.ads (Build_Set_Size_Function): Replace Tag_Node parameter
with Typ parameter.
* exp_atag.adb: Add clauses for Sinfo.Utils.
(Build_Set_Size_Function): Retrieve the TSD object statically.
* exp_disp.adb: Add clauses for Ttypes.
(Make_DT): Call Address_Image{32,64] instead of Address_Image.
(Register_Primitive): Pass Tag_Typ to Build_Set_Size_Function.
* rtsfind.ads (RTU_Id): Remove System_Address_Image and add
System_Img_Address_{32;64}.
(RE_Id): Remove entry for RE_Address_Image and add entries for
RE_Address_Image{32,64}.
* rtsfind.adb (System_Descendant): Adjust to above changes.
* libgnat/a-tags.ads (Address_Array): Suppress initialization.
* libgnat/s-addima.adb (System.Address_Image): Call the appropriate
routine based on the address size.
* libgnat/s-imad32.ads: New file.
* libgnat/s-imad64.ads: Likewise.
* libgnat/s-imagea.ads: Likewise.
* libgnat/s-imagea.adb: Likewise.
* gcc-interface/Make-lang.in (GNAT_ADA_OBJS) [$(STAGE1)=False]: Add
ada/libgnat/s-imad32.o and ada/libgnat/s-imad64.o.
Diffstat (limited to 'gcc/ada/rtsfind.adb')
-rw-r--r-- | gcc/ada/rtsfind.adb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/rtsfind.adb b/gcc/ada/rtsfind.adb index 7c9935e..4cfd9fe 100644 --- a/gcc/ada/rtsfind.adb +++ b/gcc/ada/rtsfind.adb @@ -605,7 +605,7 @@ package body Rtsfind is range Interfaces_C_Strings .. Interfaces_C_Strings; subtype System_Descendant is RTU_Id - range System_Address_Image .. System_Tasking_Stages; + range System_Address_To_Access_Conversions .. System_Tasking_Stages; subtype System_Atomic_Operations_Descendant is System_Descendant range System_Atomic_Operations_Test_And_Set .. |