aboutsummaryrefslogtreecommitdiff
path: root/gcc/sanitizer.def
AgeCommit message (Collapse)AuthorFilesLines
2013-11-04libsanitizer merge from upstream r191666Kostya Serebryany1-1/+1
This may break gcc-asan on Mac, will follow up separately. From-SVN: r204368
2013-11-03Implement -fsanitize=vla-bound.Marek Polacek1-0/+4
* opts.c (common_handle_option): Handle vla-bound. * sanitizer.def (BUILT_IN_UBSAN_HANDLE_VLA_BOUND_NOT_POSITIVE): Define. * flag-types.h (enum sanitize_code): Add SANITIZE_VLA. * asan.c (initialize_sanitizer_builtins): Build BT_FN_VOID_PTR_PTR. c-family/ * c-ubsan.c: Don't include hash-table.h. (ubsan_instrument_vla): New function. * c-ubsan.h: Declare it. cp/ * decl.c (cp_finish_decl): Move C++1y bounds checking... (compute_array_index_type): ...here. Add VLA instrumentation. Call stabilize_vla_size. (grokdeclarator): Don't call stabilize_vla_size here. c/ * c-decl.c (grokdeclarator): Add VLA instrumentation. testsuite/ * g++.dg/ubsan/cxx1y-vla.C: New test. * c-c++-common/ubsan/vla-3.c: New test. * c-c++-common/ubsan/vla-2.c: New test. * c-c++-common/ubsan/vla-4.c: New test. * c-c++-common/ubsan/vla-1.c: New test. From-SVN: r204334
2013-08-30Merge ubsan into trunk.Marek Polacek1-0/+14
From-SVN: r202113
2013-02-13libsanitizer merge from upstream r175049Kostya Serebryany1-1/+1
From-SVN: r196009
2013-01-10Update copyright years in gcc/Richard Sandiford1-1/+1
From-SVN: r195098
2012-12-13re PR sanitizer/55508 (many test cases fail using -fsanitize=address with ↵Jakub Jelinek1-11/+11
internal compiler error: in expand_call_tm) PR sanitizer/55508 * builtin-attrs.def (ATTR_TMPURE_NOTHROW_LEAF_LIST, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST): New. * asan.c (ATTR_TMPURE_NOTHROW_LEAF_LIST, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST): Define. * sanitizer.def: Make __asan_report_* and __asan_handle_no_return builtins tm pure. From-SVN: r194459
2012-12-11sanitizer.def: Add comment about importance of ordering of ↵Jakub Jelinek1-0/+2
BUILT_IN_ASAN_REPORT* builtins. * sanitizer.def: Add comment about importance of ordering of BUILT_IN_ASAN_REPORT* builtins. * cfgcleanup.c (old_insns_match_p): Don't cross-jump __asan_report_* builtins. From-SVN: r194391
2012-12-11sanitizer.def (BUILT_IN_ASAN_HANDLE_NO_RETURN): New builtin.Jakub Jelinek1-0/+3
* sanitizer.def (BUILT_IN_ASAN_HANDLE_NO_RETURN): New builtin. * asan.c (instrument_builtin_call): Change is_gimple_builtin_call gcc_assert to gcc_checking_assert. (maybe_instrument_call): Imit __builtin___asan_handle_no_return () before noreturn calls other than __builtin_trap () and __builtin_unreachable (). * c-c++-common/asan/clone-test-1.c: Remove bogus dg-shouldfail. From-SVN: r194390
2012-12-04re PR sanitizer/55439 (ThreadSanitizer: handle atomic operations)Jakub Jelinek1-0/+193
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-10/+69
* 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-22builtins.def (DEF_SANITIZER_BUILTIN): Define tsan builtins.Dmitry Vyukov1-0/+28
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