]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove Is_Descendant_Of_Address flag from Standard_Address
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 18 Mar 2023 23:24:54 +0000 (00:24 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 26 May 2023 07:29:16 +0000 (09:29 +0200)
It breaks the Allow_Integer_Address special mode.

Add new standard_address parameters to gigi and alphabetize others, this is
necessary when addresses are not treated like integers.

gcc/ada/

* back_end.adb (Call_Back_End): Add gigi_standard_address to the
signature of the gigi procedure and alphabetize other parameters.
Pass Standard_Address as actual parameter for it.
* cstand.adb (Create_Standard): Do not set Is_Descendant_Of_Address
on Standard_Address.
* gcc-interface/gigi.h (gigi): Add a standard_address parameter and
alphabetize others.
* gcc-interface/trans.cc (gigi): Likewise.  Record a builtin address
type and save it as the type for Standard.Address.

gcc/ada/back_end.adb
gcc/ada/cstand.adb
gcc/ada/gcc-interface/gigi.h
gcc/ada/gcc-interface/trans.cc

index 23f5abe955edc2ac0d015d5b51cdf9f522274ca2..bc370e9e9c795b9ff0bae5e1f0afb865f608ab2d 100644 (file)
@@ -103,11 +103,12 @@ package body Back_End is
          number_file                   : Nat;
 
          file_info_ptr                 : Address;
+         gigi_standard_address         : Entity_Id;
          gigi_standard_boolean         : Entity_Id;
-         gigi_standard_integer         : Entity_Id;
          gigi_standard_character       : Entity_Id;
-         gigi_standard_long_long_float : Entity_Id;
          gigi_standard_exception_type  : Entity_Id;
+         gigi_standard_integer         : Entity_Id;
+         gigi_standard_long_long_float : Entity_Id;
          gigi_operating_mode           : Back_End_Mode_Type);
 
       pragma Import (C, gigi);
@@ -171,11 +172,12 @@ package body Back_End is
          number_file        => Num_Source_Files,
 
          file_info_ptr                 => File_Info_Array'Address,
+         gigi_standard_address         => Standard_Address,
          gigi_standard_boolean         => Standard_Boolean,
-         gigi_standard_integer         => Standard_Integer,
          gigi_standard_character       => Standard_Character,
-         gigi_standard_long_long_float => Standard_Long_Long_Float,
          gigi_standard_exception_type  => Standard_Exception_Type,
+         gigi_standard_integer         => Standard_Integer,
+         gigi_standard_long_long_float => Standard_Long_Long_Float,
          gigi_operating_mode           => Mode);
    end Call_Back_End;
 
index d4a420deda96e303dda2bf957676a11922ef314a..fbd5888b19812704e41e58ca5a9fc9c6aa8fbe1e 100644 (file)
@@ -1370,11 +1370,9 @@ package body CStand is
 
       --  Standard_Address is not user visible, but is used internally. It is
       --  an unsigned type mod 2**System_Address_Size with System.Address size.
-      --  We flag it as Is_Descendant_Of_Address for code generation purposes.
 
       Standard_Address := New_Standard_Entity ("standard_address");
       Build_Unsigned_Integer_Type (Standard_Address, System_Address_Size);
-      Set_Is_Descendant_Of_Address (Standard_Address);
 
       --  Note: universal integer and universal real are constructed as fully
       --  formed signed numeric types, with parameters corresponding to the
index fee0450a3381384901ced5cbb4b85a91d413adb7..ec85ce44bc36d785cf40397d4f495abed7620708 100644 (file)
@@ -245,11 +245,12 @@ extern void gigi (Node_Id gnat_root,
                  struct List_Header *list_headers_ptr,
                  Nat number_file,
                  struct File_Info_Type *file_info_ptr,
+                 Entity_Id standard_address,
                  Entity_Id standard_boolean,
-                 Entity_Id standard_integer,
                  Entity_Id standard_character,
-                 Entity_Id standard_long_long_float,
                  Entity_Id standard_exception_type,
+                 Entity_Id standard_integer,
+                 Entity_Id standard_long_long_float,
                  Int gigi_operating_mode);
 
 #ifdef __cplusplus
index c26f1b6e1ac8eff324a94eb44d604b048b20e53c..13f438c424b92895e9d3eb299fb475ff7d6915bf 100644 (file)
@@ -290,11 +290,12 @@ gigi (Node_Id gnat_root,
       struct List_Header *list_headers_ptr,
       Nat number_file,
       struct File_Info_Type *file_info_ptr,
+      Entity_Id standard_address,
       Entity_Id standard_boolean,
-      Entity_Id standard_integer,
       Entity_Id standard_character,
-      Entity_Id standard_long_long_float,
       Entity_Id standard_exception_type,
+      Entity_Id standard_integer,
+      Entity_Id standard_long_long_float,
       Int gigi_operating_mode)
 {
   Node_Id gnat_iter;
@@ -375,14 +376,19 @@ gigi (Node_Id gnat_root,
   double_float_alignment = get_target_double_float_alignment ();
   double_scalar_alignment = get_target_double_scalar_alignment ();
 
-  /* Record the builtin types.  Define `integer' and `character' first so that
-     dbx will output them first.  */
+  /* Record the builtin types.  */
+  record_builtin_type ("address", pointer_sized_int_node, false);
   record_builtin_type ("integer", integer_type_node, false);
   record_builtin_type ("character", char_type_node, false);
   record_builtin_type ("boolean", boolean_type_node, false);
   record_builtin_type ("void", void_type_node, false);
 
-  /* Save the type we made for integer as the type for Standard.Integer.  */
+  /* Save the type we made for address as the type for Standard.Address.  */
+  save_gnu_tree (Base_Type (standard_address),
+                TYPE_NAME (pointer_sized_int_node),
+                false);
+
+  /* Likewise for integer as the type for Standard.Integer.  */
   save_gnu_tree (Base_Type (standard_integer),
                 TYPE_NAME (integer_type_node),
                 false);