The restriction is implementation defined and only enforced at compile time by 
GNAT, so Storage_Error is never raised at run time.

Tested on x86-64/Linux, applied on the mainline.


2026-02-22  Eric Botcazou  <[email protected]>

        PR ada/124192
        * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
        (Max_Tasks): Adjust description.
        * gnat_rm.texi: Regenerate.

-- 
Eric Botcazou
diff --git a/gcc/ada/doc/gnat_rm/standard_and_implementation_defined_restrictions.rst b/gcc/ada/doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
index 1f0aa030f2c..2945a124226 100644
--- a/gcc/ada/doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
+++ b/gcc/ada/doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
@@ -95,11 +95,12 @@ Max_Tasks
 ---------
 .. index:: Max_Tasks
 
-[RM D.7] Specifies the maximum number of task that may be created, not
+[RM D.7] Specifies the maximum number of tasks that may be created, not
 counting the creation of the environment task.  Violations of this
-restriction with a value of zero are detected at compile
-time. Violations of this restriction with values other than zero cause
-Storage_Error to be raised.
+restriction with a value of zero are detected at compile time in all
+contexts.  Violations of this restriction with a value greater than
+zero are detected for library-level tasks at compile time, but are
+not detected for local tasks at all.
 
 No_Abort_Statements
 -------------------
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index a5fb7f0bb97..7f2fdbdbfa4 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -13016,11 +13016,12 @@ corresponding bound is static.
 
 @geindex Max_Tasks
 
-[RM D.7] Specifies the maximum number of task that may be created, not
+[RM D.7] Specifies the maximum number of tasks that may be created, not
 counting the creation of the environment task.  Violations of this
-restriction with a value of zero are detected at compile
-time. Violations of this restriction with values other than zero cause
-Storage_Error to be raised.
+restriction with a value of zero are detected at compile time in all
+contexts.  Violations of this restriction with a value greater than
+zero are detected for library-level tasks at compile time, but are
+not detected for local tasks at all.
 
 @node No_Abort_Statements,No_Access_Parameter_Allocators,Max_Tasks,Partition-Wide Restrictions
 @anchor{gnat_rm/standard_and_implementation_defined_restrictions no-abort-statements}@anchor{1dd}

Reply via email to