From: ebotcazou Date: Wed, 6 Dec 2017 09:42:57 +0000 (+0000) Subject: PR ada/66205 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41cb1ea74e2cf2778a7f39a53effc99b2647f6fd;p=thirdparty%2Fgcc.git PR ada/66205 * bindgen.adb (Gen_AdaFinal): If the restriction No_Task_Termination is set, generate a null body. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255441 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 2619b162c3a1..3168ba485016 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2017-12-06 Simon Wright + + PR ada/66205 + * bindgen.adb (Gen_AdaFinal): If the restriction No_Task_Termination is + set, generate a null body. + 2017-12-05 Piotr Trojanek * sem_util.adb (Contains_Refined_State): Remove. diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb index e3d875bc8cc5..44d521e8c46b 100644 --- a/gcc/ada/bindgen.adb +++ b/gcc/ada/bindgen.adb @@ -450,6 +450,18 @@ package body Bindgen is begin WBI (" procedure " & Ada_Final_Name.all & " is"); + -- If task termination is not allowed, as is the case in restricted + -- runtimes, such as Ravenscar or ZFP, but may not be the case for all + -- configurable runtimes, we do not need program-level finalization. + + if Cumulative_Restrictions.Set (No_Task_Termination) then + WBI (" begin"); + WBI (" null;"); + WBI (" end " & Ada_Final_Name.all & ";"); + WBI (""); + return; + end if; + -- Call s_stalib_adafinal to await termination of tasks and so on. We -- want to do this if there is a main program, either in Ada or in some -- other language. (Note that Bind_Main_Program is True for Ada mains,