aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2023-06-28 01:36:53 -0300
committerMarc Poulhiès <poulhies@adacore.com>2023-07-10 14:41:39 +0200
commitd4d6eda9427ff4616c49092cd92e4e99f16300ed (patch)
treea76f8d3c14fd8ff9a7339c717a9701df1d65aaf9
parent61736805341e4fabd1c5e0f46b15b459ad98179e (diff)
downloadgcc-d4d6eda9427ff4616c49092cd92e4e99f16300ed.zip
gcc-d4d6eda9427ff4616c49092cd92e4e99f16300ed.tar.gz
gcc-d4d6eda9427ff4616c49092cd92e4e99f16300ed.tar.bz2
ada: hardcfr: optionally disable in leaf functions
Document -fhardcfr-skip-leaf. gcc/ada/ * doc/gnat_rm/security_hardening_features.rst (Control Flow Hardening): Document -fhardcfr-skip-leaf. * gnat_rm.texi: Regenerate.
-rw-r--r--gcc/ada/doc/gnat_rm/security_hardening_features.rst5
-rw-r--r--gcc/ada/gnat_rm.texi5
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ada/doc/gnat_rm/security_hardening_features.rst b/gcc/ada/doc/gnat_rm/security_hardening_features.rst
index cf8c8a2..e057af2 100644
--- a/gcc/ada/doc/gnat_rm/security_hardening_features.rst
+++ b/gcc/ada/doc/gnat_rm/security_hardening_features.rst
@@ -369,6 +369,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.
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 988bb77..0d11be0 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -29515,6 +29515,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
+@code{-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.