From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 483EB3858002; Fri, 23 Jun 2023 20:13:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 483EB3858002 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687551207; bh=2USCHCOzL27gDP9i6YE4cP2m2xR2Hjsq6grO/ot3QRo=; h=From:To:Subject:Date:From; b=kTr+ydelK+SR1iTChXd0pRhuuAQeHci+kdSU7QRuLDtZhEqJCEOOzSIbk2SosKxED oX3YociMt0/PhYt6MdSwyTdIXUzY/upuE5EAVlu2KzZKXszUh7E7axnxKPcTOHX6pj y+mDLVHGinlCm46t+dVpgxWedCCXlaENdfBPNj9M= 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: b56e58d510f090bd70470dcb02b23253946883da X-Git-Newrev: ec47223398099e0c099664f444feb34f8108612b Message-Id: <20230623201327.483EB3858002@sourceware.org> Date: Fri, 23 Jun 2023 20:13:27 +0000 (GMT) List-Id: https://gcc.gnu.org/g:ec47223398099e0c099664f444feb34f8108612b commit ec47223398099e0c099664f444feb34f8108612b Author: Alexandre Oliva Date: Fri Jun 16 03:24:27 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 283933cca50..80a73706294 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