public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED] ada: Add leafy mode for zero-call-used-regs
@ 2023-07-10 12:43 Marc Poulhiès
  0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2023-07-10 12:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: Alexandre Oliva

From: Alexandre Oliva <oliva@adacore.com>

Document leafy mode.

gcc/ada/

	* doc/gnat_rm/security_hardening_features.rst (Register
	Scrubbing): Document leafy mode.
	* gnat_rm.texi: Regenerate.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/doc/gnat_rm/security_hardening_features.rst | 6 ++++++
 gcc/ada/gnat_rm.texi                                | 8 +++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/doc/gnat_rm/security_hardening_features.rst b/gcc/ada/doc/gnat_rm/security_hardening_features.rst
index ad165cd6849..14328598c33 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 call-clobbered registers, either
+     --  those it uses itself, if it can be identified as a leaf
+     --  function, or all of them otherwise.
+
 
 For usage and more details on the command-line option, on the
 ``zero_call_used_regs`` attribute, and on their use with other
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index b28e6ebfffa..817ba0b9108 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -19,7 +19,7 @@
 
 @copying
 @quotation
-GNAT Reference Manual , Jul 04, 2023
+GNAT Reference Manual , Jul 10, 2023
 
 AdaCore
 
@@ -29191,6 +29191,12 @@ pragma Machine_Attribute (Foo, "zero_call_used_regs", "used");
 function Bar return Integer;
 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 call-clobbered registers, either
+--  those it uses itself, if it can be identified as a leaf
+--  function, or all of them otherwise.
 @end example
 
 For usage and more details on the command-line option, on the
-- 
2.40.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-10 12:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-10 12:43 [COMMITTED] ada: Add leafy mode for zero-call-used-regs Marc Poulhiès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).