From: Ronan Desplanques <desplanq...@adacore.com> 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. Tested on x86_64-pc-linux-gnu, committed on master. --- 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 e6bfbf1bb37..4e7ed5a380a 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 38206179dfc..fc489e7f3c3 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, -- 2.43.0