aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2020-10-27 09:24:51 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-11-26 03:39:53 -0500
commit52424b13d80af31b6004995c1910fb9ee0ab1939 (patch)
treeb46de0c4384093fc74a54d78efb4b4cf320ec1dd /gcc
parent9597d24c7f80ac78eb9beb0b4c8a6310b1c847d3 (diff)
downloadgcc-52424b13d80af31b6004995c1910fb9ee0ab1939.zip
gcc-52424b13d80af31b6004995c1910fb9ee0ab1939.tar.gz
gcc-52424b13d80af31b6004995c1910fb9ee0ab1939.tar.bz2
[Ada] Crash on task declaration with Restriction_Warning (No_Tasking)
gcc/ada/ * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings): when the restriction is a configuration pragma and specifies No_Tasking, a global flag is set to reject task declarations, and to prevent the construction of Master entities. The flag must not be set if the pragma is a Restriction_Warning, in which case task declarationns are allowed.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_prag.adb9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 9c57ee3..02cf0bc 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -10438,10 +10438,13 @@ package body Sem_Prag is
Add_To_Config_Boolean_Restrictions (No_Elaboration_Code);
end if;
- -- Special processing for No_Tasking restriction placed in
- -- a configuration pragmas file.
+ -- Special processing for No_Tasking restriction (not just a
+ -- warning) when it appears as a configuration pragmas.
- elsif R_Id = No_Tasking and then No (Cunit (Main_Unit)) then
+ elsif R_Id = No_Tasking
+ and then No (Cunit (Main_Unit))
+ and then not Warn
+ then
Set_Global_No_Tasking;
end if;