[gcc r16-1213] ada: Remove Size_Check_Code field from entities
Marc Poulhies
dkm@gcc.gnu.org
Fri Jun 6 08:40:25 GMT 2025
https://gcc.gnu.org/g:3d8a56ced13c48f8ee156b1a6af6ba078401429d
commit r16-1213-g3d8a56ced13c48f8ee156b1a6af6ba078401429d
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Thu Feb 13 12:07:37 2025 +0100
ada: Remove Size_Check_Code field from entities
It has been unused for a very long time.
gcc/ada/ChangeLog:
* einfo.ads (Size_Check_Code): Delete.
* gen_il-fields.ads (Opt_Field_Enum): Remove Size_Check_Code.
* gen_il-gen-gen_entities.adb (Constant_Or_Variable_Kind): Likewise.
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove call
to Kill_Size_Check_Code.
* sem_prag.adb (Analyze_Pragma): Likewise.
* sem_util.ads (Kill_Size_Check_Code): Delete.
* sem_util.adb (Kill_Size_Check_Code): Likewise.
Diff:
---
gcc/ada/einfo.ads | 7 -------
gcc/ada/gen_il-fields.ads | 1 -
gcc/ada/gen_il-gen-gen_entities.adb | 1 -
gcc/ada/sem_ch13.adb | 5 -----
gcc/ada/sem_prag.adb | 3 ---
gcc/ada/sem_util.adb | 14 --------------
gcc/ada/sem_util.ads | 6 ------
7 files changed, 37 deletions(-)
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index 1fce2f98b8f9..7a7765d1272d 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -4388,11 +4388,6 @@ package Einfo is
-- set, in which case this is the entity for the associated instance of
-- System.Shared_Storage.Shared_Var_Procs. See Exp_Smem for full details.
--- Size_Check_Code
--- Defined in constants and variables. Normally Empty. Set if code is
--- generated to check the size of the object. This field is used to
--- suppress this code if a subsequent address clause is encountered.
-
-- Size_Clause (synthesized)
-- Applies to all entities. If a size or value size clause is present in
-- the rep item chain for an entity then that attribute definition clause
@@ -5316,7 +5311,6 @@ package Einfo is
-- Actual_Subtype
-- Renamed_Object
-- Renamed_Entity $$$
- -- Size_Check_Code (constants only)
-- Prival_Link (privals only)
-- Interface_Name (constants only)
-- Related_Type (constants only)
@@ -6202,7 +6196,6 @@ package Einfo is
-- Renamed_Object
-- Renamed_Entity $$$
-- Discriminal_Link $$$
- -- Size_Check_Code
-- Prival_Link
-- Interface_Name
-- Shared_Var_Procs_Instance
diff --git a/gcc/ada/gen_il-fields.ads b/gcc/ada/gen_il-fields.ads
index fe6d3387cfa9..f957f7f64327 100644
--- a/gcc/ada/gen_il-fields.ads
+++ b/gcc/ada/gen_il-fields.ads
@@ -893,7 +893,6 @@ package Gen_IL.Fields is
Scope_Depth_Value,
Sec_Stack_Needed_For_Return,
Shared_Var_Procs_Instance,
- Size_Check_Code,
Size_Depends_On_Discriminant,
Size_Known_At_Compile_Time,
Small_Value,
diff --git a/gcc/ada/gen_il-gen-gen_entities.adb b/gcc/ada/gen_il-gen-gen_entities.adb
index 530af9085303..85ab62a0af73 100644
--- a/gcc/ada/gen_il-gen-gen_entities.adb
+++ b/gcc/ada/gen_il-gen-gen_entities.adb
@@ -357,7 +357,6 @@ begin -- Gen_IL.Gen.Gen_Entities
Sm (Prival_Link, Node_Id),
Sm (Related_Type, Node_Id),
Sm (Return_Statement, Node_Id),
- Sm (Size_Check_Code, Node_Id),
Sm (SPARK_Pragma, Node_Id),
Sm (SPARK_Pragma_Inherited, Flag)));
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 69e18b049b99..de5716e6fd08 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -6278,11 +6278,6 @@ package body Sem_Ch13 is
then
Set_Check_Address_Alignment (N);
end if;
-
- -- Kill the size check code, since we are not allocating
- -- the variable, it is somewhere else.
-
- Kill_Size_Check_Code (U_Ent);
end;
-- Not a valid entity for an address clause
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index fafd27454d9e..b37a9ad06a54 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -10029,7 +10029,6 @@ package body Sem_Prag is
end if;
Def_Id := Entity (Def_Id);
- Kill_Size_Check_Code (Def_Id);
if Ekind (Def_Id) /= E_Constant then
Note_Possible_Modification
(Get_Pragma_Arg (Arg1), Sure => False);
@@ -10042,7 +10041,6 @@ package body Sem_Prag is
-- purposes of legality checks and removal of ignored Ghost code.
Mark_Ghost_Pragma (N, Def_Id);
- Kill_Size_Check_Code (Def_Id);
if Ekind (Def_Id) /= E_Constant then
Note_Possible_Modification
(Get_Pragma_Arg (Arg2), Sure => False);
@@ -19946,7 +19944,6 @@ package body Sem_Prag is
-- object to be imported.
if Ekind (Def_Id) = E_Variable then
- Kill_Size_Check_Code (Def_Id);
Note_Possible_Modification (Id, Sure => False);
-- Initialization is not allowed for imported variable
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 97dc4c0af8b9..1196e09f2076 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -21959,20 +21959,6 @@ package body Sem_Util is
end loop Scope_Loop;
end Kill_Current_Values;
- --------------------------
- -- Kill_Size_Check_Code --
- --------------------------
-
- procedure Kill_Size_Check_Code (E : Entity_Id) is
- begin
- if (Ekind (E) = E_Constant or else Ekind (E) = E_Variable)
- and then Present (Size_Check_Code (E))
- then
- Remove (Size_Check_Code (E));
- Set_Size_Check_Code (E, Empty);
- end if;
- end Kill_Size_Check_Code;
-
--------------------
-- Known_Non_Null --
--------------------
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index 167b0966dad2..c88724f8626a 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -2540,12 +2540,6 @@ package Sem_Util is
-- if the entity Ent is not for an object. Last_Assignment_Only has the
-- same meaning as for the call with no Ent.
- procedure Kill_Size_Check_Code (E : Entity_Id);
- -- Called when an address clause or pragma Import is applied to an entity.
- -- If the entity is a variable or a constant, and size check code is
- -- present, this size check code is killed, since the object will not be
- -- allocated by the program.
-
function Known_Non_Null (N : Node_Id) return Boolean;
-- Given a node N for a subexpression of an access type, determines if
-- this subexpression yields a value that is known at compile time to
More information about the Gcc-cvs
mailing list