diff options
author | Martin Liska <mliska@suse.cz> | 2016-10-24 09:00:53 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2016-10-24 07:00:53 +0000 |
commit | 866c72a837a675573a684d3275cd562ff156d940 (patch) | |
tree | 82479a6afe1a6bc492ad6bab970f45d7d4382d5c /gcc | |
parent | af460fd74a4b1023b598951ca16a7e137848ea39 (diff) | |
download | gcc-866c72a837a675573a684d3275cd562ff156d940.zip gcc-866c72a837a675573a684d3275cd562ff156d940.tar.gz gcc-866c72a837a675573a684d3275cd562ff156d940.tar.bz2 |
Do not disable aggressive loop opts for
PR sanitizer/77966
* opts.c (finish_options): Skip conditionally.
PR sanitizer/77966
* c-c++-common/ubsan/unreachable-3.c: New test.
From-SVN: r241463
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/opts.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/ubsan/unreachable-3.c | 21 |
4 files changed, 32 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4c4583e..e654d8a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-10-24 Martin Liska <mliska@suse.cz> + + PR sanitizer/77966 + * opts.c (finish_options): Skip conditionally. + 2016-10-23 Martin Sebor <msebor@redhat.com> PR target/77837 @@ -973,7 +973,7 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, opts->x_flag_delete_null_pointer_checks = 0; /* Aggressive compiler optimizations may cause false negatives. */ - if (opts->x_flag_sanitize) + if (opts->x_flag_sanitize & ~(SANITIZE_LEAK | SANITIZE_UNREACHABLE)) { opts->x_flag_aggressive_loop_optimizations = 0; opts->x_flag_strict_overflow = 0; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 35da701..97fca40 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-10-24 Martin Liska <mliska@suse.cz> + + PR sanitizer/77966 + * c-c++-common/ubsan/unreachable-3.c: New test. + 2016-10-23 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/77763 diff --git a/gcc/testsuite/c-c++-common/ubsan/unreachable-3.c b/gcc/testsuite/c-c++-common/ubsan/unreachable-3.c new file mode 100644 index 0000000..b7a0d1a --- /dev/null +++ b/gcc/testsuite/c-c++-common/ubsan/unreachable-3.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-fsanitize=unreachable -O2 -fno-reorder-blocks -fsanitize-coverage=trace-pc -fdump-tree-optimized" } */ +/* { dg-skip-if "" { *-*-* } { "-flto" } } */ + +extern unsigned int ioread32(void *); +struct vnic_wq_ctrl { + unsigned int error_status; +}; +struct snic { + unsigned int wq_count; + struct vnic_wq_ctrl *wq[1]; + int wq_lock[1]; +}; +void snic_log_q_error(struct snic *snic) +{ + unsigned int i; + for (i = 0; i < snic->wq_count; i++) + ioread32(&snic->wq[i]->error_status); +} + +/* { dg-final { scan-tree-dump "__builtin___ubsan_handle_builtin_unreachable" "optimized" } } */ |