[Ada] Secondary stack and a-tags
commitdea655ad57bc17377c87306e0c538ad8c065493d
authorArnaud Charlet <charlet@adacore.com>
Sun, 3 Apr 2022 08:08:48 +0000 (3 08:08 +0000)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 18 May 2022 08:41:03 +0000 (18 08:41 +0000)
tree3577de0ce62bc2aa44a68389b22a3ed8bab8ff99
parent7c77ec1199c3a3d1ac48c9d963b8389c10a2a5bf
[Ada] Secondary stack and a-tags

The simple use of Ada.Tags triggers a dependency on the secondary stack
mechanism, which is unwanted on small embedded targets. To avoid this
dependency, we special case a-tags.ali in ALI.Scan_ALI to not set
Sec_Stack_Used. If some other code calls one of the functions returning
a string, this code will also be marked as requiring the secondary
stack. We also remove the need to import and set __gnat_binder_ss_count
in this case by ensuring this variable defaults to 0.

gcc/ada/

* ali.adb (Scan_ALI): Special case a-tags.ali when setting
Sec_Stack_Used.
* bindgen.adb (Gen_Adainit): Simplify handling of secondary
stack related code, and only import __gnat_binder_ss_count when
needed.
* libgnat/s-secsta.adb (Binder_SS_Count): Default initialize to
0.
gcc/ada/ali.adb
gcc/ada/bindgen.adb
gcc/ada/libgnat/s-secsta.adb