asan.c (instrument_derefs): Disable instrumentation on asan-globals=0.

2015-03-11  Marat Zakirov  <m.zakirov@samsung.com>

	* asan.c (instrument_derefs): Disable instrumentation on asan-globals=0.
	* c-c++-common/asan/no-asan-check-glob.c: New test.

From-SVN: r221345
This commit is contained in:
Marat Zakirov 2015-03-11 07:39:20 +00:00 committed by Marat Zakirov
parent df4893c390
commit 6b98fab5f1
4 changed files with 23 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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" } } */