diff options
author | Arnaud Charlet <charlet@adacore.com> | 2020-01-22 06:43:54 -0500 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-04 05:11:01 -0400 |
commit | 528576de0bd3bf7154952d9b5e7ced2b4ed7f038 (patch) | |
tree | 278e069614f29e947c238035a70b4da010954e1e /gcc/ada/libgnat/g-excact.adb | |
parent | 32cc67203388abd9559b8acc6997b3c26dcc7080 (diff) | |
download | gcc-528576de0bd3bf7154952d9b5e7ced2b4ed7f038.zip gcc-528576de0bd3bf7154952d9b5e7ced2b4ed7f038.tar.gz gcc-528576de0bd3bf7154952d9b5e7ced2b4ed7f038.tar.bz2 |
[Ada] New procedure Register_Global_Unhandled_Action
2020-06-04 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* libgnat/a-exextr.adb (Global_Unhandled_Action): New global
variable.
(Notify_Exception): Take into account Global_Unhandled_Action
and fix latent race condition.
(Exception_Action): Mark Favor_Top_Level so that variables can
be atomic.
(Global_Action): Mark atomic to remove the need for a lock.
* libgnat/g-excact.ads, libgnat/g-excact.adb
(Register_Global_Unhandled_Action): New procedure.
(Register_Global_Action): Remove lock.
* libgnat/s-stalib.ads (Raise_Action): Mark Favor_Top_Level to
be compatible with Exception_Action.
* sem_warn.adb (Warn_On_Unreferenced_Entity): Fix logic wrt
Volatile entities and entities with an address clause: the code
did not match the comment/intent.
Diffstat (limited to 'gcc/ada/libgnat/g-excact.adb')
-rw-r--r-- | gcc/ada/libgnat/g-excact.adb | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/gcc/ada/libgnat/g-excact.adb b/gcc/ada/libgnat/g-excact.adb index 39eb5a5..202d9e2 100644 --- a/gcc/ada/libgnat/g-excact.adb +++ b/gcc/ada/libgnat/g-excact.adb @@ -38,9 +38,19 @@ with System.Exception_Table; use System.Exception_Table; package body GNAT.Exception_Actions is Global_Action : Exception_Action; - pragma Import (C, Global_Action, "__gnat_exception_actions_global_action"); + pragma Import + (Ada, Global_Action, "__gnat_exception_actions_global_action"); + pragma Atomic (Global_Action); -- Imported from Ada.Exceptions. Any change in the external name needs to - -- be coordinated with a-except.adb + -- be coordinated with a-exextr.adb. + + Global_Unhandled_Action : Exception_Action; + pragma Import + (Ada, Global_Unhandled_Action, + "__gnat_exception_actions_global_unhandled_action"); + pragma Atomic (Global_Unhandled_Action); + -- Imported from Ada.Exceptions. Any change in the external name needs to + -- be coordinated with a-exextr.adb. Raise_Hook_Initialized : Boolean; pragma Import @@ -61,11 +71,18 @@ package body GNAT.Exception_Actions is procedure Register_Global_Action (Action : Exception_Action) is begin - Lock_Task.all; Global_Action := Action; - Unlock_Task.all; end Register_Global_Action; + -------------------------------------- + -- Register_Global_Unhandled_Action -- + -------------------------------------- + + procedure Register_Global_Unhandled_Action (Action : Exception_Action) is + begin + Global_Unhandled_Action := Action; + end Register_Global_Unhandled_Action; + ------------------------ -- Register_Id_Action -- ------------------------ |