From: Alexandre Oliva Date: Wed, 28 Jun 2023 04:36:53 +0000 (-0300) Subject: ada: hardcfr: optionally disable in leaf functions X-Git-Tag: basepoints/gcc-15~7728 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d4d6eda9427ff4616c49092cd92e4e99f16300ed;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/ada/doc/gnat_rm/security_hardening_features.rst b/gcc/ada/doc/gnat_rm/security_hardening_features.rst index cf8c8a2493d7..e057af2ea127 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 988bb7791052..0d11be0c188e 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.