diff options
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/asan.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/asan/no-asan-check-glob.c | 13 |
4 files changed, 23 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b77fb5e..4a7f788 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2015-03-11 Marat Zakirov <m.zakirov@samsung.com> + + * asan.c (instrument_derefs): Disable instrumentation on asan-globals=0. + 2015-03-10 Jakub Jelinek <jakub@redhat.com> PR target/65368 @@ -1820,6 +1820,8 @@ instrument_derefs (gimple_stmt_iterator *iter, tree t, { if (DECL_THREAD_LOCAL_P (inner)) return; + if (!ASAN_GLOBALS && is_global_var (inner)) + return; if (!TREE_STATIC (inner)) { /* Automatic vars in the current function will be always diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a45346a..7253a53 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-03-11 Marat Zakirov <m.zakirov@samsung.com> + + * c-c++-common/asan/no-asan-check-glob.c: New test. + 2015-03-10 Paolo Carlini <paolo.carlini@oracle.com> PR c++/65370 diff --git a/gcc/testsuite/c-c++-common/asan/no-asan-check-glob.c b/gcc/testsuite/c-c++-common/asan/no-asan-check-glob.c new file mode 100644 index 0000000..a1b1410 --- /dev/null +++ b/gcc/testsuite/c-c++-common/asan/no-asan-check-glob.c @@ -0,0 +1,13 @@ +/* { dg-options "--param asan-globals=0 -fdump-tree-asan" } */ +/* { dg-do compile } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } { "*" } } */ + +extern int a; + +int foo () +{ + return a; +} + +/* { dg-final { scan-tree-dump-times "ASAN_CHECK" 0 "asan1" } } */ +/* { dg-final { cleanup-tree-dump "asan1" } } */ |