]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Don't create calls to Abort_Undefer when not Abort_Allowed
authorGhjuvan Lacambre <lacambre@adacore.com>
Tue, 15 Mar 2022 09:57:45 +0000 (10:57 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 17 May 2022 08:25:44 +0000 (08:25 +0000)
Prevent creation of references to Abort_Undefer when aborts aren't
allowed. Another solution could have been an early return at
Expand_N_Asynchronous_Select's beginning, but this would break backends
that currently expect trees that do not contain any
N_Asynchronous_Selects in their AST (e.g. CodePeer).

gcc/ada/

* exp_ch9.adb (Expand_N_Asynchronous_Select): Don't generate
Abort_Undefers when not Abort_Allowed.

gcc/ada/exp_ch9.adb

index f70678059799d92b0772c2d7b4d9038f578ab9b0..0e551ab868cc266cf31ee121ff0efcce907e908a 100644 (file)
@@ -7812,7 +7812,9 @@ package body Exp_Ch9 is
 
          Hdle := New_List (Build_Abort_Block_Handler (Loc));
 
-         Prepend_To (Astats, Build_Runtime_Call (Loc, RE_Abort_Undefer));
+         if Abort_Allowed then
+            Prepend_To (Astats, Build_Runtime_Call (Loc, RE_Abort_Undefer));
+         end if;
 
          Abortable_Block :=
            Make_Block_Statement (Loc,