config/ * bootstrap-ubsan.mk (POSTSTAGE1_LDFLAGS): Add -ldl. gcc/c-family/ * c-ubsan.c (ubsan_instrument_division): Adjust ubsan_create_data call. (ubsan_instrument_shift): Likewise. (ubsan_instrument_vla): Likewise. gcc/ * opts.c (common_handle_option): Add -fsanitize=null option. Turn off -fdelete-null-pointer-checks option when doing the NULL pointer checking. * sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH): Add. * tree-pass.h (make_pass_ubsan): Declare. (make_pass_sanopt): Declare. * timevar.def (TV_TREE_UBSAN): New timevar. * passes.def: Add pass_sanopt and pass_ubsan. * ubsan.h (ubsan_null_ckind): New enum. (ubsan_mismatch_data): New struct. (ubsan_expand_null_ifn): Declare. (ubsan_create_data): Adjust declaration. (ubsan_type_descriptor): Likewise. * asan.c: Include "ubsan.h". (pass_data_sanopt): New pass. (execute_sanopt): New function. (gate_sanopt): Likewise. (make_pass_sanopt): Likewise. (class pass_sanopt): New class. * ubsan.c: Include tree-pass.h, gimple-ssa.h, gimple-walk.h, gimple-iterator.h and cfgloop.h. (PROB_VERY_UNLIKELY): Define. (tree_type_map_hash): New function. (ubsan_type_descriptor): Add new parameter. Improve type name generation. (ubsan_create_data): Add new parameter. Add pointer data into ubsan structure. (ubsan_expand_null_ifn): New function. (instrument_member_call): Likewise. (instrument_mem_ref): Likewise. (instrument_null): Likewise. (ubsan_pass): Likewise. (gate_ubsan): Likewise. (make_pass_ubsan): Likewise. (ubsan_instrument_unreachable): Adjust ubsan_create_data call. (class pass_ubsan): New class. (pass_data_ubsan): New pass. * flag-types.h (enum sanitize_code): Add SANITIZE_NULL. * internal-fn.c (expand_UBSAN_NULL): New function. * cgraphunit.c (varpool_finalize_decl): Call varpool_assemble_decl even when !flag_toplevel_reorder. * internal-fn.def (UBSAN_NULL): New. gcc/testsuite/ * c-c++-common/ubsan/null-1.c: New test. * c-c++-common/ubsan/null-2.c: New test. * c-c++-common/ubsan/null-3.c: New test. * c-c++-common/ubsan/null-4.c: New test. * c-c++-common/ubsan/null-5.c: New test. * c-c++-common/ubsan/null-6.c: New test. * c-c++-common/ubsan/null-7.c: New test. * c-c++-common/ubsan/null-8.c: New test. * c-c++-common/ubsan/null-9.c: New test. * c-c++-common/ubsan/null-10.c: New test. * c-c++-common/ubsan/null-11.c: New test. * gcc.dg/ubsan/c99-shift-2.c: Adjust dg-output. * c-c++-common/ubsan/shift-1.c: Likewise. * c-c++-common/ubsan/div-by-zero-3.c: Likewise. From-SVN: r205021
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
ChangeLog | Loading commit data... | |
acinclude.m4 | Loading commit data... | |
acx.m4 | Loading commit data... | |
asmcfi.m4 | Loading commit data... | |
bootstrap-O1.mk | Loading commit data... | |
bootstrap-O3.mk | Loading commit data... | |
bootstrap-asan.mk | Loading commit data... | |
bootstrap-debug-big.mk | Loading commit data... | |
bootstrap-debug-ckovw.mk | Loading commit data... | |
bootstrap-debug-lean.mk | Loading commit data... | |
bootstrap-debug-lib.mk | Loading commit data... | |
bootstrap-debug.mk | Loading commit data... | |
bootstrap-lto.mk | Loading commit data... | |
bootstrap-time.mk | Loading commit data... | |
bootstrap-ubsan.mk | Loading commit data... | |
cloog.m4 | Loading commit data... | |
codeset.m4 | Loading commit data... | |
depstand.m4 | Loading commit data... | |
dfp.m4 | Loading commit data... | |
elf.m4 | Loading commit data... | |
enable.m4 | Loading commit data... | |
extensions.m4 | Loading commit data... | |
futex.m4 | Loading commit data... | |
gc++filt.m4 | Loading commit data... | |
gettext-sister.m4 | Loading commit data... | |
gettext.m4 | Loading commit data... | |
glibc21.m4 | Loading commit data... | |
gthr.m4 | Loading commit data... | |
gxx-include-dir.m4 | Loading commit data... | |
iconv.m4 | Loading commit data... | |
intdiv0.m4 | Loading commit data... | |
inttypes-pri.m4 | Loading commit data... | |
inttypes.m4 | Loading commit data... | |
inttypes_h.m4 | Loading commit data... | |
isl.m4 | Loading commit data... | |
largefile.m4 | Loading commit data... | |
lcmessage.m4 | Loading commit data... | |
ld-symbolic.m4 | Loading commit data... | |
lead-dot.m4 | Loading commit data... | |
lib-ld.m4 | Loading commit data... | |
lib-link.m4 | Loading commit data... | |
lib-prefix.m4 | Loading commit data... | |
libstdc++-raw-cxx.m4 | Loading commit data... | |
lthostflags.m4 | Loading commit data... | |
math.m4 | Loading commit data... | |
mh-cygwin | Loading commit data... | |
mh-darwin | Loading commit data... | |
mh-djgpp | Loading commit data... | |
mh-mingw | Loading commit data... | |
mh-pa | Loading commit data... | |
mh-pa-hpux10 | Loading commit data... | |
mh-ppc-aix | Loading commit data... | |
mmap.m4 | Loading commit data... | |
mt-alphaieee | Loading commit data... | |
mt-d30v | Loading commit data... | |
mt-gnu | Loading commit data... | |
mt-mips-elfoabi | Loading commit data... | |
mt-mips-gnu | Loading commit data... | |
mt-mips16-compat | Loading commit data... | |
mt-ospace | Loading commit data... | |
mt-sde | Loading commit data... | |
mt-spu | Loading commit data... | |
multi.m4 | Loading commit data... | |
nls.m4 | Loading commit data... | |
no-executables.m4 | Loading commit data... | |
override.m4 | Loading commit data... | |
picflag.m4 | Loading commit data... | |
plugins.m4 | Loading commit data... | |
po.m4 | Loading commit data... | |
proginstall.m4 | Loading commit data... | |
progtest.m4 | Loading commit data... | |
stdint.m4 | Loading commit data... | |
stdint_h.m4 | Loading commit data... | |
tcl.m4 | Loading commit data... | |
tls.m4 | Loading commit data... | |
uintmax_t.m4 | Loading commit data... | |
ulonglong.m4 | Loading commit data... | |
unwind_ipinfo.m4 | Loading commit data... | |
warnings.m4 | Loading commit data... | |
weakref.m4 | Loading commit data... | |
zlib.m4 | Loading commit data... |