diff options
author | Martin Liska <mliska@suse.cz> | 2016-09-26 12:55:34 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2016-09-26 10:55:34 +0000 |
commit | 5cc6c41c2ee95585418a5820d34a4356b91dda18 (patch) | |
tree | dfdcff0777887158eb50d49f939f910bd45980c8 /gcc/doc | |
parent | 759a6472610921efcc41de343332b86d197e123c (diff) | |
download | gcc-5cc6c41c2ee95585418a5820d34a4356b91dda18.zip gcc-5cc6c41c2ee95585418a5820d34a4356b91dda18.tar.gz gcc-5cc6c41c2ee95585418a5820d34a4356b91dda18.tar.bz2 |
Fix handling of -fsanitize-recover* options.
* common.opt: Exclude SANITIZE_UNREACHABLE and SANITIZE_RETURN
from default sanitize recover values.
* doc/invoke.texi: Fix documentation related to -fsanitize=leak,
-fsanitize=address, -fsanitize=thread and -fsanitize-recover.
* flag-types.h: Replace couple of 1 << x to 1UL << x, make it
consistent.
* opts.c (finish_options): Do a generic loop over options
that can be recovered.
(parse_sanitizer_options): Exclude SANITIZE_UNREACHABLE and
SANITIZE_RETURN.
(common_handle_option): Likewise.
* opts.h: Declare can_recover to sanitizer_opts_s.
* c-c++-common/ubsan/sanitize-recover-1.c: New test.
* c-c++-common/ubsan/sanitize-recover-2.c: New test.
* c-c++-common/ubsan/sanitize-recover-3.c: New test.
* c-c++-common/ubsan/sanitize-recover-4.c: New test.
* c-c++-common/ubsan/sanitize-recover-5.c: New test.
* c-c++-common/ubsan/sanitize-recover-6.c: New test.
* c-c++-common/ubsan/sanitize-recover-7.c: New test.
* c-c++-common/ubsan/sanitize-recover-8.c: New test.
* c-c++-common/ubsan/sanitize-recover-9.c: New test.
From-SVN: r240491
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index ce0eaef..6767462 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -10255,6 +10255,7 @@ more details. The run-time behavior can be influenced using the the available options are shown at startup of the instrumented program. See @url{https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags} for a list of supported options. +The option can't be combined with @option{-fsanitize=thread}. @item -fsanitize=kernel-address @opindex fsanitize=kernel-address @@ -10270,17 +10271,19 @@ details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS} environment variable; see @url{https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags} for a list of supported options. +The option can't be combined with @option{-fsanitize=address} +and/or @option{-fsanitize=leak}. @item -fsanitize=leak @opindex fsanitize=leak Enable LeakSanitizer, a memory leak detector. -This option only matters for linking of executables and if neither -@option{-fsanitize=address} nor @option{-fsanitize=thread} is used. In that -case the executable is linked against a library that overrides @code{malloc} +This option only matters for linking of executables and +the executable is linked against a library that overrides @code{malloc} and other allocator functions. See @uref{https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer} for more details. The run-time behavior can be influenced using the @env{LSAN_OPTIONS} environment variable. +The option can't be combined with @option{-fsanitize=thread}. @item -fsanitize=undefined @opindex fsanitize=undefined @@ -10454,6 +10457,7 @@ and program then exits with a non-zero exit code. Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}), @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero}, +@option{-fsanitize=bounds-strict}, @option{-fsanitize=kernel-address} and @option{-fsanitize=address}. For these sanitizers error recovery is turned on by default, except @option{-fsanitize=address}, for which this feature is experimental. @@ -10470,12 +10474,12 @@ setting the @code{halt_on_error} flag in the corresponding environment variable. Syntax without explicit @var{opts} parameter is deprecated. It is equivalent to @smallexample --fsanitize-recover=undefined,float-cast-overflow,float-divide-by-zero +-fsanitize-recover=undefined,float-cast-overflow,float-divide-by-zero,bounds-strict @end smallexample @noindent Similarly @option{-fno-sanitize-recover} is equivalent to @smallexample --fno-sanitize-recover=undefined,float-cast-overflow,float-divide-by-zero +-fno-sanitize-recover=undefined,float-cast-overflow,float-divide-by-zero,bounds-strict @end smallexample @item -fsanitize-undefined-trap-on-error |