]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix crash with global No_Tasking and async delays
authorDenis Mazzucato <mazzucato@adacore.com>
Tue, 8 Jul 2025 11:00:08 +0000 (13:00 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 9 Sep 2025 12:39:51 +0000 (14:39 +0200)
When optimizations are enabled, the runtime for delays is inlined and expanded.
If No_Tasking is set globally, for instance via a configuration file, then the
initialization of _Master, _Chain, and _Task_Name formals is skipped for task
entities. Later during expansion, these identifiers are expected but won't be
found, crashing the compiler. This patch fixes Init_Formals by removing the
check on Global_No_Tasking. If a No_Tasking restriction applies, then a
violation error will be raised when analyzing the task type.

gcc/ada/ChangeLog:

* exp_ch3.adb (Init_Formals): Remove the check on Global_No_Tasking.
* sem.adb: Fix typo.

gcc/ada/exp_ch3.adb
gcc/ada/sem.adb

index 00b3aae0bd9ea77b40e94e91ad7b8afca42677c9..e83b0e392db074c9ee6b2cf3b4857265443e2760 100644 (file)
@@ -10786,11 +10786,9 @@ package body Exp_Ch3 is
                        or else (Is_Record_Type (Typ)
                                  and then Is_Protected_Record_Type (Typ));
       With_Task  : constant Boolean :=
-                     not Global_No_Tasking
-                       and then
-                     (Has_Task (Typ)
-                        or else (Is_Record_Type (Typ)
-                                   and then Is_Task_Record_Type (Typ)));
+                     Has_Task (Typ)
+                       or else (Is_Record_Type (Typ)
+                                 and then Is_Task_Record_Type (Typ));
       Formals : List_Id;
 
    begin
index 731a97daaec934ff3cd845159513420e606a9605..71e759e74c41bd9c44f82ed795db7b4c623157a2 100644 (file)
@@ -1562,7 +1562,7 @@ package body Sem is
 
       --  Compile predefined units with GNAT_Mode set to True, to properly
       --  process the categorization stuff. However, do not set GNAT_Mode
-      --  to True for the renamings units (Text_IO, IO_Exceptions, Direct_IO,
+      --  to True for the renaming units (Text_IO, IO_Exceptions, Direct_IO,
       --  Sequential_IO) as this would prevent pragma Extend_System from being
       --  taken into account, for example when Text_IO is renaming DEC.Text_IO.