[gcc(refs/users/aoliva/heads/testme)] Add leafy mode for zero-call-used-regs [ada doc]

Alexandre Oliva aoliva@gcc.gnu.org
Fri Jun 9 08:07:44 GMT 2023


https://gcc.gnu.org/g:b1fd01a3ef6d797e2528b676460675eac90255b8

commit b1fd01a3ef6d797e2528b676460675eac90255b8
Author: Alexandre Oliva <oliva@gnu.org>
Date:   Thu Jun 8 01:35:34 2023 -0300

    Add leafy mode for zero-call-used-regs [ada doc]
    
    Document leafy mode.
    
    
    for  gcc/ada/ChangeLog
    
            * doc/gnat_rm/security_hardening_features.rst (Register
            Scrubbing): Document leafy mode.

Diff:
---
 gcc/ada/doc/gnat_rm/security_hardening_features.rst | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gcc/ada/doc/gnat_rm/security_hardening_features.rst b/gcc/ada/doc/gnat_rm/security_hardening_features.rst
index 4ea38b14df1..29c897b21dd 100644
--- a/gcc/ada/doc/gnat_rm/security_hardening_features.rst
+++ b/gcc/ada/doc/gnat_rm/security_hardening_features.rst
@@ -34,6 +34,12 @@ subprograms.
      pragma Machine_Attribute (Bar, "zero_call_used_regs", "all");
      --  Before returning, Bar scrubs all call-clobbered registers.
 
+     function Baz return Integer;
+     pragma Machine_Attribute (Bar, "zero_call_used_regs", "leafy");
+     --  Before returning, Bar scrubs only call-clobbered registers
+     --  that it uses itself, if it can be identified as a leaf
+     --  function, or all such registers otherwise.
+
 
 For usage and more details on the command-line option, on the
 ``zero_call_used_regs`` attribute, and on their use with other


More information about the Gcc-cvs mailing list