From: Alexandre Oliva Date: Wed, 28 Jun 2023 04:36:51 +0000 (-0300) Subject: ada: hardcfr: mark throw-expected functions X-Git-Tag: basepoints/gcc-15~7729 X-Git-Url: https://gcc.gnu.org/git/?a=commitdiff_plain;h=61736805341e4fabd1c5e0f46b15b459ad98179e;p=gcc.git ada: hardcfr: mark throw-expected functions Adjust documentation to reflect the introduction of -fhardcfr-check-noreturn-calls=no-xthrow. gcc/ada/ * doc/gnat_rm/security_hardening_features.rst (Control Flow Redundancy): Add -fhardcfr-check-noreturn-calls=no-xthrow. * 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 14328598c33f..cf8c8a2493d7 100644 --- a/gcc/ada/doc/gnat_rm/security_hardening_features.rst +++ b/gcc/ada/doc/gnat_rm/security_hardening_features.rst @@ -493,17 +493,18 @@ gets modified as follows: end; -Verification may also be performed before No_Return calls, whether -only nothrow ones, with -:switch:`-fhardcfr-check-noreturn-calls=nothrow`, or all of them, with -:switch:`-fhardcfr-check-noreturn-calls=always`. The default is -:switch:`-fhardcfr-check-noreturn-calls=never` for this feature, that -disables checking before No_Return calls. +Verification may also be performed before No_Return calls, whether all +of them, with :switch:`-fhardcfr-check-noreturn-calls=always`; all but +internal subprograms involved in exception-raising or -reraising, with +:switch:`-fhardcfr-check-noreturn-calls=no-xthrow` (default); only +nothrow ones, with :switch:`-fhardcfr-check-noreturn-calls=nothrow`; +or none, with :switch:`-fhardcfr-check-noreturn-calls=never`. When a No_Return call returns control to its caller through an exception, verification may have already been performed before the -call, if :switch:`-fhardcfr-check-noreturn-calls=always` is in effect. -The compiler arranges for already-checked No_Return calls without a +call, if :switch:`-fhardcfr-check-noreturn-calls=always` or +:switch:`-fhardcfr-check-noreturn-calls=no-xthrow` is in effect. The +compiler arranges for already-checked No_Return calls without a preexisting handler to bypass the implicitly-added cleanup handler and thus the redundant check, but a local exception or cleanup handler, if present, will modify the set of visited blocks, and checking will take diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 817ba0b91088..988bb7791052 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -29634,17 +29634,18 @@ exception end; @end example -Verification may also be performed before No_Return calls, whether -only nothrow ones, with -@code{-fhardcfr-check-noreturn-calls=nothrow}, or all of them, with -@code{-fhardcfr-check-noreturn-calls=always}. The default is -@code{-fhardcfr-check-noreturn-calls=never} for this feature, that -disables checking before No_Return calls. +Verification may also be performed before No_Return calls, whether all +of them, with @code{-fhardcfr-check-noreturn-calls=always}; all but +internal subprograms involved in exception-raising or -reraising, with +@code{-fhardcfr-check-noreturn-calls=no-xthrow} (default); only +nothrow ones, with @code{-fhardcfr-check-noreturn-calls=nothrow}; +or none, with @code{-fhardcfr-check-noreturn-calls=never}. When a No_Return call returns control to its caller through an exception, verification may have already been performed before the -call, if @code{-fhardcfr-check-noreturn-calls=always} is in effect. -The compiler arranges for already-checked No_Return calls without a +call, if @code{-fhardcfr-check-noreturn-calls=always} or +@code{-fhardcfr-check-noreturn-calls=no-xthrow} is in effect. The +compiler arranges for already-checked No_Return calls without a preexisting handler to bypass the implicitly-added cleanup handler and thus the redundant check, but a local exception or cleanup handler, if present, will modify the set of visited blocks, and checking will take