aboutsummaryrefslogtreecommitdiff
path: root/gcc/tsan.c
AgeCommit message (Collapse)AuthorFilesLines
2013-01-10Update copyright years in gcc/Richard Sandiford1-1/+1
From-SVN: r195098
2012-12-04tsan.c (instrument_expr): If expr_ptr isn't a gimple val, first store it ↵Jakub Jelinek1-11/+16
into a SSA_NAME. * tsan.c (instrument_expr): If expr_ptr isn't a gimple val, first store it into a SSA_NAME. From-SVN: r194135
2012-12-04re PR sanitizer/55439 (ThreadSanitizer: handle atomic operations)Jakub Jelinek1-6/+409
PR sanitizer/55439 * Makefile.in (tsan.o): Depend on tree-ssa-propagate.h. * sanitizer.def: Add __tsan_atomic* builtins. * asan.c (initialize_sanitizer_builtins): Adjust to also initialize __tsan_atomic* builtins. * tsan.c: Include tree-ssa-propagate.h. (enum tsan_atomic_action): New enum. (tsan_atomic_table): New table. (instrument_builtin_call): New function. (instrument_gimple): Take pointer to gimple_stmt_iterator instead of gimple_stmt_iterator. Call instrument_builtin_call on builtin call stmts. (instrument_memory_accesses): Adjust instrument_gimple caller. * builtin-types.def (BT_FN_BOOL_VPTR_PTR_I1_INT_INT, BT_FN_BOOL_VPTR_PTR_I2_INT_INT, BT_FN_BOOL_VPTR_PTR_I4_INT_INT, BT_FN_BOOL_VPTR_PTR_I8_INT_INT, BT_FN_BOOL_VPTR_PTR_I16_INT_INT): New. From-SVN: r194133
2012-12-03sanitizer.def: Add Address Sanitizer builtins.Jakub Jelinek1-18/+18
* sanitizer.def: Add Address Sanitizer builtins. Rename BUILT_IN_TSAN_READ_* to BUILT_IN_TSAN_READ* and BUILT_IN_TSAN_WRITE_* to BUILT_IN_TSAN_WRITE*. * Makefile.in (asan.o): Depend on langhooks.h. (tsan.o): Depend on asan.h. * asan.h (initialize_sanitizer_builtins): New prototype. * asan.c: Include langhooks.h. (report_error_func): Use builtin_decl_implicit of corresponding BUILT_IN_ASAN_REPORT_{LOAD,STORE}*. (asan_init_func): Removed. (initialize_sanitizer_builtins): New function. (asan_finish_file): Call it. Use builtin_decl_implicit on BUILT_IN_ASAN_{INIT,{,UN}REGISTER_GLOBALS}. (asan_instrument): Call initialize_sanitizer_builtins. * builtins.def (DEF_SANITIZER_BUILTIN): Change condition to (flag_asan || flag_tsan). * tsan.c: Include asan.h and tsan.h. (get_memory_access_decl): Rename BUILT_IN_TSAN_{READ,WRITE}_* to BUILT_IN_TSAN_{READ,WRITE}*. (tsan_pass): Call initialize_sanitizer_builtins. (tsan_gate, tsan_gate_O0): Don't check if builtin_decl_implicit_p (BUILT_IN_TSAN_INIT) is true. (tsan_finish_file): Call initialize_sanitizer_builtins. * builtin-types.def (BT_FN_VOID_PTR_PTRMODE): New fn type. From-SVN: r194103
2012-11-30tsan.c (is_load_of_const_p): Removed.Jakub Jelinek1-57/+21
* tsan.c (is_load_of_const_p): Removed. (instrument_expr): Use result of get_inner_reference instead of get_base_address, avoid some unnecessary tests, use !pt_solution_includes and !may_be_aliased tests to check whether base might escape current function. From-SVN: r193989
2012-11-23tsan.c: Fix up comment formatting.Jakub Jelinek1-10/+9
* tsan.c: Fix up comment formatting. (instrument_gimple): Ignore gimple_clobber_p stmts. (pass_tsan, pass_tsan_O0): Remove TODO_update_address_taken from todo_flags_finish. From-SVN: r193755
2012-11-22builtins.def (DEF_SANITIZER_BUILTIN): Define tsan builtins.Dmitry Vyukov1-0/+405
2012-11-22 Dmitry Vyukov <dvyukov@google.com> Wei Mi <wmi@google.com> * builtins.def (DEF_SANITIZER_BUILTIN): Define tsan builtins. * sanitizer.def: Ditto. * Makefile.in (tsan.o): Add tsan.o target. (BUILTINS_DEF): Add sanitizer.def. * passes.c (init_optimization_passes): Add tsan passes. * tree-pass.h (register_pass_info): Ditto. * toplev.c (compile_file): Ditto. * doc/invoke.texi: Document tsan related options. * gcc.c (LINK_COMMAND_SPEC): Add LIBTSAN_SPEC in link command if -fsanitize=thread. * tsan.c: New file about tsan. * tsan.h: Ditto. * common.opt: Add -fsanitize=thread. Co-Authored-By: Wei Mi <wmi@google.com> From-SVN: r193736