diff options
author | Martin Liska <mliska@suse.cz> | 2017-03-10 14:24:45 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2017-03-10 13:24:45 +0000 |
commit | 8823ce3f54a875c2523264ddf3342bc54cdf10eb (patch) | |
tree | ae3fd8506b2f139ad2ff8a99c72c1db504ee9132 /gcc/toplev.c | |
parent | 74106ead26b17f3e68b73c6704632cbbbf762a5c (diff) | |
download | gcc-8823ce3f54a875c2523264ddf3342bc54cdf10eb.zip gcc-8823ce3f54a875c2523264ddf3342bc54cdf10eb.tar.gz gcc-8823ce3f54a875c2523264ddf3342bc54cdf10eb.tar.bz2 |
MPX: Fix option handling.
2017-03-10 Martin Liska <mliska@suse.cz>
PR target/65705
PR target/69804
* toplev.c (process_options): Enable MPX with LSAN and UBSAN.
* tree-chkp.c (chkp_walk_pointer_assignments): Verify that
FIELD != NULL.
From-SVN: r246027
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index 6a7e4fb..54a4f05 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1270,31 +1270,39 @@ process_options (void) if (targetm.chkp_bound_mode () == VOIDmode) { error_at (UNKNOWN_LOCATION, - "-fcheck-pointer-bounds is not supported for this target"); + "%<-fcheck-pointer-bounds%> is not supported for this " + "target"); flag_check_pointer_bounds = 0; } - if (flag_sanitize) + if (flag_sanitize & SANITIZE_BOUNDS_STRICT) { - if (flag_sanitize & SANITIZE_ADDRESS) - error_at (UNKNOWN_LOCATION, - "-fcheck-pointer-bounds is not supported with " - "Address Sanitizer"); - - if (flag_sanitize & (SANITIZE_UNDEFINED | SANITIZE_NONDEFAULT)) - error_at (UNKNOWN_LOCATION, - "-fcheck-pointer-bounds is not supported with " - "Undefined Behavior Sanitizer"); - - if (flag_sanitize & SANITIZE_LEAK) - error_at (UNKNOWN_LOCATION, - "-fcheck-pointer-bounds is not supported with " - "Leak Sanitizer"); - - if (flag_sanitize & SANITIZE_THREAD) - error_at (UNKNOWN_LOCATION, - "-fcheck-pointer-bounds is not supported with " - "Thread Sanitizer"); + error_at (UNKNOWN_LOCATION, + "%<-fcheck-pointer-bounds%> is not supported with " + "%<-fsanitize=bounds-strict%>"); + flag_check_pointer_bounds = 0; + } + else if (flag_sanitize & SANITIZE_BOUNDS) + { + error_at (UNKNOWN_LOCATION, + "%<-fcheck-pointer-bounds%> is not supported with " + "%<-fsanitize=bounds%>"); + flag_check_pointer_bounds = 0; + } + + if (flag_sanitize & SANITIZE_ADDRESS) + { + error_at (UNKNOWN_LOCATION, + "%<-fcheck-pointer-bounds%> is not supported with " + "Address Sanitizer"); + flag_check_pointer_bounds = 0; + } + + if (flag_sanitize & SANITIZE_THREAD) + { + error_at (UNKNOWN_LOCATION, + "%<-fcheck-pointer-bounds%> is not supported with " + "Thread Sanitizer"); flag_check_pointer_bounds = 0; } |