From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 63C25385773C; Fri, 9 Jun 2023 06:17:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 63C25385773C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686291463; bh=h7ZcwuldzGRkje4A2gSKWDQk8M9pg3CzeTQnPRDyRqY=; h=From:To:Subject:Date:From; b=moDv6U/0xIcW3wxx7rh7lSnFsjUF8LDbWf5vbETj+VU/fszzSRJc7bh7pbA9Ym6Y0 8IqcqecbnnL7q9GBOIt0twma7ql/9xmL0htAguUwrp4zpGIxKbhiB51EJ2uB1mkJbY 9KcmGzdN1B4HHstokRpMsmmJBZQx+AORHwGtgp4k= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] Add leafy mode for zero-call-used-regs [ada doc] X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: d6f494022996bdaf2c9e5e2310d5a5c5f5598c04 X-Git-Newrev: 2a59ca7e08477690bfa25ce128a1bc9697be8ed0 Message-Id: <20230609061743.63C25385773C@sourceware.org> Date: Fri, 9 Jun 2023 06:17:43 +0000 (GMT) List-Id: https://gcc.gnu.org/g:2a59ca7e08477690bfa25ce128a1bc9697be8ed0 commit 2a59ca7e08477690bfa25ce128a1bc9697be8ed0 Author: Alexandre Oliva 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