From: Martin Liska Date: Mon, 13 Jun 2016 07:17:16 +0000 (+0200) Subject: Do not enable -fcheck-pointer-bounds w/ -fsanitize=bounds X-Git-Tag: upstream/12.2.0~46475 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5843a5f0a2d875ac67b098e6a8eae0501e31fe16;p=platform%2Fupstream%2Fgcc.git Do not enable -fcheck-pointer-bounds w/ -fsanitize=bounds PR sanitizer/71458 * toplev.c (process_options): Do not enable -fcheck-pointer-bounds w/ -fsanitize=bounds. * gcc.target/i386/pr71458.c: New test. From-SVN: r237353 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c2f2a0b..3ea7a01 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-06-13 Martin Liska + + PR sanitizer/71458 + * toplev.c (process_options): Do not enable -fcheck-pointer-bounds + w/ -fsanitize=bounds. + 2016-06-12 Uros Bizjak * config/i386/i386.c (ix86_init_builtins): Calculate diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 426c8ad..f324515 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-06-13 Martin Liska + + * gcc.target/i386/pr71458.c: New test. + 2016-06-12 Uros Bizjak PR target/71241 diff --git a/gcc/testsuite/gcc.target/i386/pr71458.c b/gcc/testsuite/gcc.target/i386/pr71458.c new file mode 100644 index 0000000..27e7764 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr71458.c @@ -0,0 +1,7 @@ +/* { dg-do compile { target { ! x32 } } } */ +/* { dg-options "-fcheck-pointer-bounds -mmpx -fsanitize=bounds" } */ +/* { dg-error "-fcheck-pointer-bounds is not supported with -fsanitize=bounds" "" { target *-*-* } 0 } */ + +enum {} a[0]; +void fn1(int); +void fn2() { fn1(a[-1]); } diff --git a/gcc/toplev.c b/gcc/toplev.c index 543b8a3..f51d2cb 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1276,6 +1276,15 @@ process_options (void) "Address Sanitizer"); flag_check_pointer_bounds = 0; } + + if (flag_sanitize & SANITIZE_BOUNDS) + { + error_at (UNKNOWN_LOCATION, + "-fcheck-pointer-bounds is not supported with " + "-fsanitize=bounds"); + flag_check_pointer_bounds = 0; + } + } /* One region RA really helps to decrease the code size. */