diff options
author | Maxim Ostapenko <m.ostapenko@samsung.com> | 2016-05-19 12:05:59 +0000 |
---|---|---|
committer | Maxim Ostapenko <chefmax@gcc.gnu.org> | 2016-05-19 15:05:59 +0300 |
commit | f3510625cf2035e6876246a9689db10163e96830 (patch) | |
tree | 66ed7694eb6d390d58101fcea55a0f9e4321f9c5 /gcc/cppbuiltin.c | |
parent | 73fb6a9d96d1213ad90da2723c5fbb4f9da97c45 (diff) | |
download | gcc-f3510625cf2035e6876246a9689db10163e96830.tar.gz |
re PR sanitizer/64354 (no preprocessor symbol __SANITIZE_THREAD__)
2016-05-19 Maxim Ostapenko <m.ostapenko@samsung.com>
PR sanitizer/64354
* cppbuiltin.c (define_builtin_macros_for_compilation_flags): Add new
builtin __SANITIZE_THREAD__ macros for fsanitize=thread switch.
* doc/cpp.texi: Document new macros.
* c-c++-common/tsan/sanitize-thread-macro.c: New test.
From-SVN: r236457
Diffstat (limited to 'gcc/cppbuiltin.c')
-rw-r--r-- | gcc/cppbuiltin.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cppbuiltin.c b/gcc/cppbuiltin.c index 6d494add73b..69ccdb91846 100644 --- a/gcc/cppbuiltin.c +++ b/gcc/cppbuiltin.c @@ -92,6 +92,9 @@ define_builtin_macros_for_compilation_flags (cpp_reader *pfile) if (flag_sanitize & SANITIZE_ADDRESS) cpp_define (pfile, "__SANITIZE_ADDRESS__"); + if (flag_sanitize & SANITIZE_THREAD) + cpp_define (pfile, "__SANITIZE_THREAD__"); + if (optimize_size) cpp_define (pfile, "__OPTIMIZE_SIZE__"); if (optimize) |