ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch builtins...
authorJakub Jelinek <jakub@redhat.com>
Thu, 19 Oct 2017 11:23:59 +0000 (13:23 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 19 Oct 2017 11:23:59 +0000 (13:23 +0200)
commit5d3805fca3e9a199fbaa18aee3c05ecb30ebca61
tree22f091462fe7932142888d43abb6ff39f610e7f7
parent93659712d9807d7ef01d472dc58119f4ac15cbad
ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch builtins...

* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
builtins, store max (log2 (align), 0) into uchar field instead of
align into uptr field.
(ubsan_expand_objsize_ifn): Use _v1 suffixed type mismatch builtins,
store uchar 0 field instead of uptr 0 field.
(instrument_nonnull_return): Use _v1 suffixed nonnull return builtin,
instead of passing one address of struct with 2 locations pass
two addresses of structs with 1 location each.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): Removed.
(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1_ABORT): New builtins.

* c-c++-common/ubsan/float-cast-overflow-1.c: Drop value keyword
from expected output regexps.
* c-c++-common/ubsan/float-cast-overflow-2.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-3.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-4.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-5.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-6.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-10.c: Likewise.
* g++.dg/ubsan/float-cast-overflow-bf.C: Likewise.
* gcc.dg/ubsan/float-cast-overflow-bf.c: Likewise.
* g++.dg/asan/default-options-1.C (__asan_default_options): Add
used attribute.
* g++.dg/asan/asan_test.C: Run with ASAN_OPTIONS=handle_segv=2
in the environment.

* All source files: Merge from upstream 315899.
        * asan/Makefile.am (nodist_saninclude_HEADERS): Add
include/sanitizer/tsan_interface.h.
        * asan/libtool-version: Bump the libasan SONAME.
* lsan/Makefile.am (sanitizer_lsan_files): Add lsan_common_mac.cc.
(lsan_files): Add lsan_linux.cc, lsan_mac.cc and lsan_malloc_mac.cc.
        * sanitizer_common/Makefile.am (sanitizer_common_files): Add
sancov_flags.cc, sanitizer_allocator_checks.cc,
sanitizer_coverage_libcdep_new.cc, sanitizer_errno.cc,
sanitizer_file.cc, sanitizer_mac_libcdep.cc and
sanitizer_stoptheworld_mac.cc.  Remove sanitizer_coverage_libcdep.cc
and sanitizer_coverage_mapping_libcdep.cc.
        * tsan/Makefile.am (tsan_files): Add tsan_external.cc.
* ubsan/Makefile.am (DEFS): Add -DUBSAN_CAN_USE_CXXABI=1.
(ubsan_files): Add ubsan_init_standalone.cc and
ubsan_signals_standalone.cc.
* ubsan/libtool-version: Bump the libubsan SONAME.
        * asan/Makefile.in: Regenerate.
        * lsan/Makefile.in: Regenerate.
        * sanitizer_common/Makefile.in: Regenerate.
        * tsan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Regenerate.

From-SVN: r253887
278 files changed:
gcc/ChangeLog
gcc/sanitizer.def
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-1.c
gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-10.c
gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-2.c
gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-3.c
gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-4.c
gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-5.c
gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-6.c
gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-8.c
gcc/testsuite/c-c++-common/ubsan/float-cast-overflow-9.c
gcc/testsuite/g++.dg/asan/asan_test.C
gcc/testsuite/g++.dg/asan/default-options-1.C
gcc/testsuite/g++.dg/ubsan/float-cast-overflow-bf.C
gcc/testsuite/gcc.dg/ubsan/float-cast-overflow-bf.c
gcc/ubsan.c
libsanitizer/ChangeLog
libsanitizer/MERGE
libsanitizer/Makefile.am
libsanitizer/Makefile.in
libsanitizer/asan/Makefile.am
libsanitizer/asan/Makefile.in
libsanitizer/asan/asan_activation.cc
libsanitizer/asan/asan_activation_flags.inc
libsanitizer/asan/asan_allocator.cc
libsanitizer/asan/asan_allocator.h
libsanitizer/asan/asan_descriptions.cc
libsanitizer/asan/asan_descriptions.h
libsanitizer/asan/asan_errors.cc
libsanitizer/asan/asan_errors.h
libsanitizer/asan/asan_fake_stack.cc
libsanitizer/asan/asan_flags.cc
libsanitizer/asan/asan_flags.inc
libsanitizer/asan/asan_fuchsia.cc [new file with mode: 0644]
libsanitizer/asan/asan_globals.cc
libsanitizer/asan/asan_globals_win.cc [new file with mode: 0644]
libsanitizer/asan/asan_interceptors.cc
libsanitizer/asan/asan_interceptors.h
libsanitizer/asan/asan_interceptors_memintrinsics.cc [new file with mode: 0644]
libsanitizer/asan/asan_interceptors_memintrinsics.h [new file with mode: 0644]
libsanitizer/asan/asan_interface.inc [new file with mode: 0644]
libsanitizer/asan/asan_interface_internal.h
libsanitizer/asan/asan_internal.h
libsanitizer/asan/asan_linux.cc
libsanitizer/asan/asan_mac.cc
libsanitizer/asan/asan_malloc_linux.cc
libsanitizer/asan/asan_malloc_win.cc
libsanitizer/asan/asan_mapping.h
libsanitizer/asan/asan_memory_profile.cc
libsanitizer/asan/asan_new_delete.cc
libsanitizer/asan/asan_poisoning.cc
libsanitizer/asan/asan_poisoning.h
libsanitizer/asan/asan_posix.cc
libsanitizer/asan/asan_report.cc
libsanitizer/asan/asan_report.h
libsanitizer/asan/asan_rtl.cc
libsanitizer/asan/asan_scariness_score.h
libsanitizer/asan/asan_shadow_setup.cc [new file with mode: 0644]
libsanitizer/asan/asan_stack.h
libsanitizer/asan/asan_suppressions.cc
libsanitizer/asan/asan_thread.cc
libsanitizer/asan/asan_thread.h
libsanitizer/asan/asan_win.cc
libsanitizer/asan/asan_win_dll_thunk.cc
libsanitizer/asan/asan_win_dynamic_runtime_thunk.cc
libsanitizer/asan/asan_win_weak_interception.cc [new file with mode: 0644]
libsanitizer/asan/libtool-version
libsanitizer/builtins/assembly.h
libsanitizer/include/sanitizer/asan_interface.h
libsanitizer/include/sanitizer/common_interface_defs.h
libsanitizer/include/sanitizer/coverage_interface.h
libsanitizer/include/sanitizer/lsan_interface.h
libsanitizer/include/sanitizer/tsan_interface.h [new file with mode: 0644]
libsanitizer/interception/interception.h
libsanitizer/interception/interception_linux.cc
libsanitizer/interception/interception_linux.h
libsanitizer/interception/interception_win.cc
libsanitizer/lsan/Makefile.am
libsanitizer/lsan/Makefile.in
libsanitizer/lsan/lsan.cc
libsanitizer/lsan/lsan.h
libsanitizer/lsan/lsan_allocator.cc
libsanitizer/lsan/lsan_allocator.h
libsanitizer/lsan/lsan_common.cc
libsanitizer/lsan/lsan_common.h
libsanitizer/lsan/lsan_common_linux.cc
libsanitizer/lsan/lsan_common_mac.cc [new file with mode: 0644]
libsanitizer/lsan/lsan_interceptors.cc
libsanitizer/lsan/lsan_linux.cc [new file with mode: 0644]
libsanitizer/lsan/lsan_mac.cc [new file with mode: 0644]
libsanitizer/lsan/lsan_malloc_mac.cc [new file with mode: 0644]
libsanitizer/lsan/lsan_thread.cc
libsanitizer/lsan/lsan_thread.h
libsanitizer/sanitizer_common/Makefile.am
libsanitizer/sanitizer_common/Makefile.in
libsanitizer/sanitizer_common/sancov_flags.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sancov_flags.h [new file with mode: 0644]
libsanitizer/sanitizer_common/sancov_flags.inc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_addrhashmap.h
libsanitizer/sanitizer_common/sanitizer_allocator.cc
libsanitizer/sanitizer_common/sanitizer_allocator.h
libsanitizer/sanitizer_common/sanitizer_allocator_checks.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_allocator_checks.h [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_allocator_combined.h
libsanitizer/sanitizer_common/sanitizer_allocator_interface.h
libsanitizer/sanitizer_common/sanitizer_allocator_internal.h
libsanitizer/sanitizer_common/sanitizer_allocator_local_cache.h
libsanitizer/sanitizer_common/sanitizer_allocator_primary32.h
libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h
libsanitizer/sanitizer_common/sanitizer_allocator_secondary.h
libsanitizer/sanitizer_common/sanitizer_allocator_size_class_map.h
libsanitizer/sanitizer_common/sanitizer_atomic.h
libsanitizer/sanitizer_common/sanitizer_atomic_clang.h
libsanitizer/sanitizer_common/sanitizer_atomic_clang_other.h
libsanitizer/sanitizer_common/sanitizer_common.cc
libsanitizer/sanitizer_common/sanitizer_common.h
libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc
libsanitizer/sanitizer_common/sanitizer_common_interceptors_format.inc
libsanitizer/sanitizer_common/sanitizer_common_interface.inc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_common_interface_posix.inc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_common_libcdep.cc
libsanitizer/sanitizer_common/sanitizer_common_nolibc.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_coverage_fuchsia.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_coverage_interface.inc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_coverage_libcdep.cc [deleted file]
libsanitizer/sanitizer_common/sanitizer_coverage_libcdep_new.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_coverage_mapping_libcdep.cc [deleted file]
libsanitizer/sanitizer_common/sanitizer_coverage_win_dll_thunk.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_coverage_win_dynamic_runtime_thunk.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_coverage_win_sections.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_coverage_win_weak_interception.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_dbghelp.h [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_errno.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_errno.h [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_errno_codes.h [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_file.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_file.h [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_flag_parser.h
libsanitizer/sanitizer_common/sanitizer_flags.h
libsanitizer/sanitizer_common/sanitizer_flags.inc
libsanitizer/sanitizer_common/sanitizer_fuchsia.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_fuchsia.h [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_interface_internal.h
libsanitizer/sanitizer_common/sanitizer_internal_defs.h
libsanitizer/sanitizer_common/sanitizer_libignore.cc
libsanitizer/sanitizer_common/sanitizer_libignore.h
libsanitizer/sanitizer_common/sanitizer_linux.cc
libsanitizer/sanitizer_common/sanitizer_linux.h
libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
libsanitizer/sanitizer_common/sanitizer_linux_s390.cc
libsanitizer/sanitizer_common/sanitizer_list.h
libsanitizer/sanitizer_common/sanitizer_mac.cc
libsanitizer/sanitizer_common/sanitizer_mac.h
libsanitizer/sanitizer_common/sanitizer_mac_libcdep.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_malloc_mac.inc
libsanitizer/sanitizer_common/sanitizer_mutex.h
libsanitizer/sanitizer_common/sanitizer_platform.h
libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h
libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
libsanitizer/sanitizer_common/sanitizer_posix.cc
libsanitizer/sanitizer_common/sanitizer_posix.h
libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc
libsanitizer/sanitizer_common/sanitizer_printf.cc
libsanitizer/sanitizer_common/sanitizer_procmaps.h
libsanitizer/sanitizer_common/sanitizer_procmaps_common.cc
libsanitizer/sanitizer_common/sanitizer_procmaps_freebsd.cc
libsanitizer/sanitizer_common/sanitizer_procmaps_linux.cc
libsanitizer/sanitizer_common/sanitizer_procmaps_mac.cc
libsanitizer/sanitizer_common/sanitizer_quarantine.h
libsanitizer/sanitizer_common/sanitizer_report_decorator.h
libsanitizer/sanitizer_common/sanitizer_signal_interceptors.inc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_stackdepot.cc
libsanitizer/sanitizer_common/sanitizer_stacktrace.cc
libsanitizer/sanitizer_common/sanitizer_stacktrace.h
libsanitizer/sanitizer_common/sanitizer_stacktrace_libcdep.cc
libsanitizer/sanitizer_common/sanitizer_stacktrace_printer.cc
libsanitizer/sanitizer_common/sanitizer_stacktrace_printer.h
libsanitizer/sanitizer_common/sanitizer_stoptheworld.h
libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
libsanitizer/sanitizer_common/sanitizer_stoptheworld_mac.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_suppressions.cc
libsanitizer/sanitizer_common/sanitizer_symbolizer.cc
libsanitizer/sanitizer_common/sanitizer_symbolizer.h
libsanitizer/sanitizer_common/sanitizer_symbolizer_fuchsia.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_symbolizer_internal.h
libsanitizer/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc
libsanitizer/sanitizer_common/sanitizer_symbolizer_libcdep.cc
libsanitizer/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
libsanitizer/sanitizer_common/sanitizer_symbolizer_win.cc
libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc
libsanitizer/sanitizer_common/sanitizer_thread_registry.cc
libsanitizer/sanitizer_common/sanitizer_thread_registry.h
libsanitizer/sanitizer_common/sanitizer_tls_get_addr.cc
libsanitizer/sanitizer_common/sanitizer_tls_get_addr.h
libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc
libsanitizer/sanitizer_common/sanitizer_win.cc
libsanitizer/sanitizer_common/sanitizer_win.h [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_win_defs.h [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_win_dll_thunk.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_win_dll_thunk.h [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_win_dynamic_runtime_thunk.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_win_weak_interception.cc [new file with mode: 0644]
libsanitizer/sanitizer_common/sanitizer_win_weak_interception.h [new file with mode: 0644]
libsanitizer/tsan/Makefile.am
libsanitizer/tsan/Makefile.in
libsanitizer/tsan/tsan_clock.cc
libsanitizer/tsan/tsan_clock.h
libsanitizer/tsan/tsan_debugging.cc
libsanitizer/tsan/tsan_defs.h
libsanitizer/tsan/tsan_dense_alloc.h
libsanitizer/tsan/tsan_external.cc [new file with mode: 0644]
libsanitizer/tsan/tsan_fd.cc
libsanitizer/tsan/tsan_flags.cc
libsanitizer/tsan/tsan_flags.h
libsanitizer/tsan/tsan_flags.inc
libsanitizer/tsan/tsan_interceptors.cc
libsanitizer/tsan/tsan_interceptors.h
libsanitizer/tsan/tsan_interceptors_mac.cc
libsanitizer/tsan/tsan_interface.cc
libsanitizer/tsan/tsan_interface.h
libsanitizer/tsan/tsan_interface_ann.cc
libsanitizer/tsan/tsan_interface_atomic.cc
libsanitizer/tsan/tsan_interface_inl.h
libsanitizer/tsan/tsan_interface_java.cc
libsanitizer/tsan/tsan_interface_java.h
libsanitizer/tsan/tsan_libdispatch_mac.cc
libsanitizer/tsan/tsan_malloc_mac.cc
libsanitizer/tsan/tsan_mman.cc
libsanitizer/tsan/tsan_mman.h
libsanitizer/tsan/tsan_new_delete.cc
libsanitizer/tsan/tsan_platform.h
libsanitizer/tsan/tsan_platform_linux.cc
libsanitizer/tsan/tsan_platform_mac.cc
libsanitizer/tsan/tsan_platform_posix.cc
libsanitizer/tsan/tsan_platform_windows.cc
libsanitizer/tsan/tsan_report.cc
libsanitizer/tsan/tsan_report.h
libsanitizer/tsan/tsan_rtl.cc
libsanitizer/tsan/tsan_rtl.h
libsanitizer/tsan/tsan_rtl_aarch64.S
libsanitizer/tsan/tsan_rtl_amd64.S
libsanitizer/tsan/tsan_rtl_mutex.cc
libsanitizer/tsan/tsan_rtl_report.cc
libsanitizer/tsan/tsan_rtl_thread.cc
libsanitizer/tsan/tsan_stat.cc
libsanitizer/tsan/tsan_stat.h
libsanitizer/tsan/tsan_suppressions.cc
libsanitizer/tsan/tsan_sync.cc
libsanitizer/tsan/tsan_sync.h
libsanitizer/tsan/tsan_trace.h
libsanitizer/ubsan/Makefile.am
libsanitizer/ubsan/Makefile.in
libsanitizer/ubsan/libtool-version
libsanitizer/ubsan/ubsan_checks.inc
libsanitizer/ubsan/ubsan_diag.cc
libsanitizer/ubsan/ubsan_diag.h
libsanitizer/ubsan/ubsan_diag_standalone.cc [new file with mode: 0644]
libsanitizer/ubsan/ubsan_flags.cc
libsanitizer/ubsan/ubsan_handlers.cc
libsanitizer/ubsan/ubsan_handlers.h
libsanitizer/ubsan/ubsan_handlers_cxx.cc
libsanitizer/ubsan/ubsan_handlers_cxx.h
libsanitizer/ubsan/ubsan_init.cc
libsanitizer/ubsan/ubsan_init.h
libsanitizer/ubsan/ubsan_init_standalone.cc
libsanitizer/ubsan/ubsan_init_standalone_preinit.cc [new file with mode: 0644]
libsanitizer/ubsan/ubsan_interface.inc [new file with mode: 0644]
libsanitizer/ubsan/ubsan_platform.h
libsanitizer/ubsan/ubsan_signals_standalone.cc [new file with mode: 0644]
libsanitizer/ubsan/ubsan_signals_standalone.h [new file with mode: 0644]
libsanitizer/ubsan/ubsan_type_hash_itanium.cc
libsanitizer/ubsan/ubsan_win_dll_thunk.cc [new file with mode: 0644]
libsanitizer/ubsan/ubsan_win_dynamic_runtime_thunk.cc [new file with mode: 0644]
libsanitizer/ubsan/ubsan_win_weak_interception.cc [new file with mode: 0644]