Commit f3510625 by Maxim Ostapenko Committed by Maxim Ostapenko

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
parent 73fb6a9d
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.
2016-05-19 Bin Cheng <bin.cheng@arm.com> 2016-05-19 Bin Cheng <bin.cheng@arm.com>
PR tree-optimization/69848 PR tree-optimization/69848
......
...@@ -92,6 +92,9 @@ define_builtin_macros_for_compilation_flags (cpp_reader *pfile) ...@@ -92,6 +92,9 @@ define_builtin_macros_for_compilation_flags (cpp_reader *pfile)
if (flag_sanitize & SANITIZE_ADDRESS) if (flag_sanitize & SANITIZE_ADDRESS)
cpp_define (pfile, "__SANITIZE_ADDRESS__"); cpp_define (pfile, "__SANITIZE_ADDRESS__");
if (flag_sanitize & SANITIZE_THREAD)
cpp_define (pfile, "__SANITIZE_THREAD__");
if (optimize_size) if (optimize_size)
cpp_define (pfile, "__OPTIMIZE_SIZE__"); cpp_define (pfile, "__OPTIMIZE_SIZE__");
if (optimize) if (optimize)
......
...@@ -2362,6 +2362,9 @@ in use. ...@@ -2362,6 +2362,9 @@ in use.
This macro is defined, with value 1, when @option{-fsanitize=address} This macro is defined, with value 1, when @option{-fsanitize=address}
or @option{-fsanitize=kernel-address} are in use. or @option{-fsanitize=kernel-address} are in use.
@item __SANITIZE_THREAD__
This macro is defined, with value 1, when @option{-fsanitize=thread} is in use.
@item __TIMESTAMP__ @item __TIMESTAMP__
This macro expands to a string constant that describes the date and time This macro expands to a string constant that describes the date and time
of the last modification of the current source file. The string constant of the last modification of the current source file. The string constant
......
2016-05-19 Maxim Ostapenko <m.ostapenko@samsung.com>
PR sanitizer/64354
* c-c++-common/tsan/sanitize-thread-macro.c: New test.
2016-05-19 Richard Biener <rguenther@suse.de> 2016-05-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/70729 PR tree-optimization/70729
......
/* Check that -fsanitize=thread options defines __SANITIZE_THREAD__ macros. */
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
int
main ()
{
#ifndef __SANITIZE_THREAD__
bad construction
#endif
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment