From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 070533857014; Fri, 9 Jun 2023 06:17:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 070533857014 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686291438; bh=DVPN4YLG6Iyf1JBT2gfW9RwhEAOv8G/xQM0r3q1fSMg=; h=From:To:Subject:Date:From; b=CqogB4eBFWEe4vIykGNPXUH9cqWYyE6CLV2/Q0GYFEIv62nAI80sg6ApcYmzYexm1 5xCK3+gp2o4bHxHqc9ainDWo7SXxg/C+wVLEb6LywICzzy/QclZhHGb1I6gWU5CLXX pwPF91qXvbQONOD4V7zxpEsHBX1CIh/xOwraX1UM= 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)] hardcfr: optionally disable in leaf functions [ada doc] X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: 2624c1e15a909e3cf422cec8ad9c8472f6f48f85 X-Git-Newrev: 4b9c64afbc0e35df2fe5e5cc87a90ebe35564fb5 Message-Id: <20230609061718.070533857014@sourceware.org> Date: Fri, 9 Jun 2023 06:17:18 +0000 (GMT) List-Id: https://gcc.gnu.org/g:4b9c64afbc0e35df2fe5e5cc87a90ebe35564fb5 commit 4b9c64afbc0e35df2fe5e5cc87a90ebe35564fb5 Author: Alexandre Oliva Date: Thu Jun 8 01:35:30 2023 -0300 hardcfr: optionally disable in leaf functions [ada doc] Document -fhardcfr-skip-leaf. for gcc/ada/ChangeLog * doc/gnat_rm/security_hardening_features.rst (Control Flow Hardening): Document -fhardcfr-skip-leaf. Diff: --- gcc/ada/doc/gnat_rm/security_hardening_features.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/ada/doc/gnat_rm/security_hardening_features.rst b/gcc/ada/doc/gnat_rm/security_hardening_features.rst index 5c45fc2d42a..4ea38b14df1 100644 --- a/gcc/ada/doc/gnat_rm/security_hardening_features.rst +++ b/gcc/ada/doc/gnat_rm/security_hardening_features.rst @@ -363,6 +363,11 @@ basic blocks take note as control flows through them, and, before returning, subprograms verify that the taken notes are consistent with the control-flow graph. +The performance impact of verification on leaf subprograms can be much +higher, while the averted risks are much lower on them. +Instrumentation can be disabled for leaf subprograms with +:switch:`-fhardcfr-skip-leaf`. + Functions with too many basic blocks, or with multiple return points, call a run-time function to perform the verification. Other functions perform the verification inline before returning.