aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/restrict.adb
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2020-03-28 14:52:14 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-15 04:04:35 -0400
commita7837c085aa5538430cdc9ffc04fcfa1f581656f (patch)
tree0f6113c2b59a1fb8d32236b6fc268c8f978d2d3e /gcc/ada/restrict.adb
parent98376aab0368fd9a1a3c7393f302002cc5d30506 (diff)
downloadgcc-a7837c085aa5538430cdc9ffc04fcfa1f581656f.zip
gcc-a7837c085aa5538430cdc9ffc04fcfa1f581656f.tar.gz
gcc-a7837c085aa5538430cdc9ffc04fcfa1f581656f.tar.bz2
[Ada] Crash in tagged type constructor with task components
2020-06-15 Javier Miranda <miranda@adacore.com> gcc/ada/ * restrict.ads (Set_Global_No_Tasking, Global_No_Tasking): New subprograms. * restrict.adb (Set_Global_No_Tasking, Global_No_Tasking): New subprograms. * sem_ch3.adb (Access_Definition): Do not skip building masters since they may be required for BIP calls. (Analyze_Subtype_Declaration): Propagate attribute Is_Limited_Record in class-wide subtypes and subtypes with cloned subtype attribute; propagate attribute Is_Limited_Interface. * sem_ch6.adb (Check_Anonymous_Return): Do not skip building masters since they may be required for BIP calls. Use Build_Master_Declaration to declare the _master variable. (Create_Extra_Formals): Add decoration of Has_Master_Entity when the _master formal is added. * exp_ch3.adb (Init_Formals): Adding formal to decorate it with attribute Has_Master_Entity when the _master formal is added. (Build_Master): Do not skip building masters since they may be required for BIP calls. (Expand_N_Object_Declaration): Ensure activation chain and master entity for objects initialized with BIP function calls. * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings): Adding support to detect and save restriction No_Tasking when set in the run-time package System or in a global configuration pragmas file. * sem_util.adb (Current_Entity_In_Scope): Overload this subprogram to allow searching for an entity by its Name. * sem_util.ads (Current_Entity_In_Scope): Update comment. * exp_ch4.adb (Expand_N_Allocator): Do not skip building masters since they may be required for BIP calls. * exp_ch6.ads (Might_Have_Tasks): New subprogram. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add support for BIP calls returning objects that may have tasks. (Make_Build_In_Place_Call_In_Allocator): Build the activation chain if the result might have tasks. (Make_Build_In_Place_Iface_Call_In_Allocator): Build the class wide master for the result type. (Might_Have_Tasks): New subprogram. (Needs_BIP_Task_Actuals): Returns False when restriction No_Tasking is globally set. * exp_ch9.ads (Build_Master_Declaration): New subprogram. * exp_ch9.adb (Build_Activation_Chain_Entity): No action performed when restriction No_Tasking is globally set. (Build_Class_Wide_Master): No action performed when restriction No_Tasking is globally set; use Build_Master_Declaration to declare the _master variable. (Build_Master_Declaration): New subprogram. (Build_Master_Entity): No action performed when restriction No_Tasking is globally set; added support to handle transient scopes and _finalizer routines. (Build_Master_Renaming): No action performed when restriction No_Tasking is globally set. (Build_Task_Activation_Call): Skip generating the call when the chain is an ignored ghost entity. (Find_Master_Scope): Generalize the code that detects transient scopes with master entity. * einfo.ads (Has_Nested_Subprogram): Minor comment reformatting.
Diffstat (limited to 'gcc/ada/restrict.adb')
-rw-r--r--gcc/ada/restrict.adb22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb
index 2c812e8..ebdc7ce 100644
--- a/gcc/ada/restrict.adb
+++ b/gcc/ada/restrict.adb
@@ -39,6 +39,10 @@ with Uname; use Uname;
package body Restrict is
+ Global_Restriction_No_Tasking : Boolean := False;
+ -- Set to True when No_Tasking is set in the run-time package System
+ -- or in a configuration pragmas file (for example, gnat.adc).
+
--------------------------------
-- Package Local Declarations --
--------------------------------
@@ -898,6 +902,15 @@ package body Restrict is
return Not_A_Restriction_Id;
end Get_Restriction_Id;
+ -----------------------
+ -- Global_No_Tasking --
+ -----------------------
+
+ function Global_No_Tasking return Boolean is
+ begin
+ return Global_Restriction_No_Tasking;
+ end Global_No_Tasking;
+
-------------------------------
-- No_Exception_Handlers_Set --
-------------------------------
@@ -1574,6 +1587,15 @@ package body Restrict is
No_Use_Of_Pragma_Warning (A_Id) := False;
end Set_Restriction_No_Use_Of_Pragma;
+ ---------------------------
+ -- Set_Global_No_Tasking --
+ ---------------------------
+
+ procedure Set_Global_No_Tasking is
+ begin
+ Global_Restriction_No_Tasking := True;
+ end Set_Global_No_Tasking;
+
----------------------------------
-- Suppress_Restriction_Message --
----------------------------------