https://gcc.gnu.org/g:5bb378b68bc58993977de344ea4f0761cdde341b

commit r15-6515-g5bb378b68bc58993977de344ea4f0761cdde341b
Author: Ronan Desplanques <desplanq...@adacore.com>
Date:   Thu Nov 28 11:08:46 2024 +0100

    ada: Fix omissions of ALI P line parameters
    
    Before this patch, the compiler would not report various tasking
    settings specified in library units when these library units did not use
    tasking, or when they were predefined. While this behavior was
    implemented deliberately, that was a long time ago and it proved to be
    a pitfall that could cause configuration pragmas to be silently ignored.
    
    This patch makes the compiler report the aforementioned tasking settings
    in ALI files unconditionally.
    
    Also, this patch fixes an incorrect statement and a couple of typos in
    the spec of Lib.Writ.
    
    gcc/ada/ChangeLog:
    
            * lib-writ.adb (Write_ALI): Remove condition for writing P line
            parameters.
            * lib-writ.ads: Fix typos. Clarify comment.

Diff:
---
 gcc/ada/lib-writ.adb | 26 ++++++++++++--------------
 gcc/ada/lib-writ.ads | 15 ++++++++-------
 2 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb
index e6bfbf1bb37b..4e7ed5a380a7 100644
--- a/gcc/ada/lib-writ.adb
+++ b/gcc/ada/lib-writ.adb
@@ -1240,22 +1240,20 @@ package body Lib.Writ is
          Write_Info_Str (" DB");
       end if;
 
-      if Tasking_Used and then not Is_Predefined_Unit (Main_Unit) then
-         if Locking_Policy /= ' ' then
-            Write_Info_Str  (" L");
-            Write_Info_Char (Locking_Policy);
-         end if;
+      if Locking_Policy /= ' ' then
+         Write_Info_Str  (" L");
+         Write_Info_Char (Locking_Policy);
+      end if;
 
-         if Queuing_Policy /= ' ' then
-            Write_Info_Str  (" Q");
-            Write_Info_Char (Queuing_Policy);
-         end if;
+      if Queuing_Policy /= ' ' then
+         Write_Info_Str  (" Q");
+         Write_Info_Char (Queuing_Policy);
+      end if;
 
-         if Task_Dispatching_Policy /= ' ' then
-            Write_Info_Str  (" T");
-            Write_Info_Char (Task_Dispatching_Policy);
-            Write_Info_Char (' ');
-         end if;
+      if Task_Dispatching_Policy /= ' ' then
+         Write_Info_Str  (" T");
+         Write_Info_Char (Task_Dispatching_Policy);
+         Write_Info_Char (' ');
       end if;
 
       if GNATprove_Mode then
diff --git a/gcc/ada/lib-writ.ads b/gcc/ada/lib-writ.ads
index 38206179dfc7..fc489e7f3c34 100644
--- a/gcc/ada/lib-writ.ads
+++ b/gcc/ada/lib-writ.ads
@@ -228,9 +228,9 @@ package Lib.Writ is
    --         OL   Pragma Default_Scalar_Storage_Order (Low_Order_First) is
    --              present in a configuration pragma file that applies.
 
-   --         Qx   A valid Queueing_Policy pragma applies to all the units
-   --              in this file, where x is the first character (upper case)
-   --              of the policy name (e.g. 'P' for Priority_Queueing).
+   --         Qx   A valid Queuing_Policy pragma applies to all the units in
+   --              this file, where x is the first character (upper case) of
+   --              the policy name (e.g. 'P' for Priority_Queuing).
 
    --         SL   Indicates that the unit is an Interface to a Standalone
    --              Library. Note that this indication is never given by the
@@ -253,10 +253,11 @@ package Lib.Writ is
    --              generated exception tables. If ZX is not present, the
    --              longjmp/setjmp exception scheme is in use.
 
-   --      Note that language defined units never output policy (Lx, Tx, Qx)
-   --      parameters. Language defined units must correctly handle all
-   --      possible cases. These values are checked for consistency by the
-   --      binder and then copied to the generated binder output file.
+   --      Note that library units from the GNAT runtime library should never
+   --      output policy (Lx, Tx, Qx) parameters. They must correctly handle
+   --      all possible cases to be usable in all contexts. These values are
+   --      checked for consistency by the binder and then copied to the
+   --      generated binder output file.
 
    --    Note: The P line must be present. Even in Ignore_Errors mode, Scan_ALI
    --    insists on finding a P line. So if changes are made to the ALI format,

Reply via email to