aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/Makefile.rtl
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2024-04-24 17:13:34 +0200
committerMarc Poulhiès <poulhies@adacore.com>2024-06-13 15:30:30 +0200
commit8d310d8ad89ca32cebe22ec9bac3980237db4e12 (patch)
tree0c4ac71a051038af2ee1571ec82ddacfb1f1b738 /gcc/ada/Makefile.rtl
parentdf9d6153e1981676b08109fbe3371ca6e9d5f755 (diff)
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/Makefile.rtl')
-rw-r--r--gcc/ada/Makefile.rtl3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index 0f5ebb87d73..1512c01f3f8 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -611,6 +611,9 @@ GNATRTL_NONTASKING_OBJS= \
s-geveop$(objext) \
s-gloloc$(objext) \
s-htable$(objext) \
+ s-imad32$(objext) \
+ s-imad64$(objext) \
+ s-imagea$(objext) \
s-imageb$(objext) \
s-imaged$(objext) \
s-imagef$(objext) \