[Ada] Secondary stack and i-c*

Message ID 20220905072602.GA1174669@poulhies-Precision-5550
State New, archived
Headers
Series [Ada] Secondary stack and i-c* |

Commit Message

Marc Poulhiès Sept. 5, 2022, 7:26 a.m. UTC
  Extend the previous changes related to Ada.Tags trigerring a
dependency on the secondary stack to various i-c* packages.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* ali.adb (Scan_ALI): Special case i-c*.ali when setting
	Sec_Stack_Used.
  

Patch

diff --git a/gcc/ada/ali.adb b/gcc/ada/ali.adb
--- a/gcc/ada/ali.adb
+++ b/gcc/ada/ali.adb
@@ -2079,15 +2079,24 @@  package body ALI is
                --  Processing for SS
 
                elsif C = 'S' then
-                  --  Special case: a-tags.ali by itself should not set
+                  --  Special case: a-tags/i-c* by themselves should not set
                   --  Sec_Stack_Used, only if other code uses the secondary
                   --  stack should we set this flag. This ensures that we do
                   --  not bring the secondary stack unnecessarily when using
-                  --  Ada.Tags and not actually using the secondary stack.
+                  --  one of these packages and not actually using the
+                  --  secondary stack.
 
-                  if Get_Name_String (F) /= "a-tags.ali" then
-                     Opt.Sec_Stack_Used := True;
-                  end if;
+                  declare
+                     File : constant String := Get_Name_String (F);
+                  begin
+                     if File /= "a-tags.ali"
+                       and then File /= "i-c.ali"
+                       and then File /= "i-cstrin.ali"
+                       and then File /= "i-cpoint.ali"
+                     then
+                        Opt.Sec_Stack_Used := True;
+                     end if;
+                  end;
 
                --  Invalid switch starting with S