diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-11-23 10:02:28 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2012-11-23 10:02:28 +0100 |
commit | 77bc5132136626017244cc4324c84e3210c8f4fc (patch) | |
tree | 5b2104a30f7e40b8672e50934d6b8b9c1f75ec85 /gcc/asan.c | |
parent | b131b583978ceadbe54325be3a09710a48481df2 (diff) | |
download | gcc-77bc5132136626017244cc4324c84e3210c8f4fc.zip gcc-77bc5132136626017244cc4324c84e3210c8f4fc.tar.gz gcc-77bc5132136626017244cc4324c84e3210c8f4fc.tar.bz2 |
re PR sanitizer/55435 ([asan] implement an attribute to disable asan instrumentation for a particular function)
PR sanitizer/55435
* c-common.c (handle_no_address_safety_analysis_attribute): New
function.
(c_common_attribute_table): Add no_address_safety_analysis.
* asan.c (gate_asan): Don't instrument functions with
no_address_safety_analysis attribute.
(gate_asan_O0): Use !optimize && gate_asan ().
* doc/extend.texi (no_address_safety_analysis): Document new
function attribute.
* c-c++-common/asan/attrib-1.c: New test.
From-SVN: r193748
Diffstat (limited to 'gcc/asan.c')
-rw-r--r-- | gcc/asan.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1587,7 +1587,9 @@ asan_instrument (void) static bool gate_asan (void) { - return flag_asan != 0; + return flag_asan != 0 + && !lookup_attribute ("no_address_safety_analysis", + DECL_ATTRIBUTES (current_function_decl)); } struct gimple_opt_pass pass_asan = @@ -1614,7 +1616,7 @@ struct gimple_opt_pass pass_asan = static bool gate_asan_O0 (void) { - return flag_asan != 0 && !optimize; + return !optimize && gate_asan (); } struct gimple_opt_pass pass_asan_O0 = |