gcc/config
Marek Polacek b9a55b135e bootstrap-ubsan.mk (POSTSTAGE1_LDFLAGS): Add -ldl.
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
2013-11-19 11:45:15 +00:00
..
acinclude.m4
acx.m4
asmcfi.m4
bootstrap-asan.mk Add -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/ 2013-02-25 08:18:39 -08:00
bootstrap-debug-big.mk
bootstrap-debug-ckovw.mk
bootstrap-debug-lean.mk
bootstrap-debug-lib.mk
bootstrap-debug.mk
bootstrap-lto.mk
bootstrap-O1.mk
bootstrap-O3.mk
bootstrap-time.mk
bootstrap-ubsan.mk bootstrap-ubsan.mk (POSTSTAGE1_LDFLAGS): Add -ldl. 2013-11-19 11:45:15 +00:00
ChangeLog bootstrap-ubsan.mk (POSTSTAGE1_LDFLAGS): Add -ldl. 2013-11-19 11:45:15 +00:00
cloog.m4 re PR other/55973 (r195150 doesn't properly handle out of tree isl 0.11.1) 2013-01-15 13:07:56 +00:00
codeset.m4
depstand.m4
dfp.m4 dfp.m4: Add support for cygwin x64 target. 2013-03-27 22:53:32 +01:00
elf.m4
enable.m4
extensions.m4
futex.m4
gc++filt.m4
gettext-sister.m4
gettext.m4
glibc21.m4
gthr.m4 gthr.m4: New. 2012-10-15 13:10:30 +00:00
gxx-include-dir.m4
iconv.m4
intdiv0.m4
inttypes_h.m4
inttypes-pri.m4
inttypes.m4
isl.m4 isl.m4: don't echo $CFLAGS for ISL_CHECK_VERSION. 2013-01-23 22:37:01 +00:00
largefile.m4
lcmessage.m4
ld-symbolic.m4
lead-dot.m4
lib-ld.m4
lib-link.m4
lib-prefix.m4
libstdc++-raw-cxx.m4 Remove "-I" from LIBSTDCXX_RAW_CXX_LDFLAGS 2013-01-07 10:23:42 -08:00
lthostflags.m4
math.m4
mh-cygwin
mh-darwin mh-darwin (BOOT_CFLAGS): Only add -mdynamic-no-pic for m32 hosts. 2013-09-29 19:16:45 +00:00
mh-djgpp
mh-mingw
mh-pa
mh-pa-hpux10
mh-ppc-aix mh-ppc-aix (LDFLAGS): Quote $(CC). 2012-05-03 15:39:07 +00:00
mmap.m4 mmap.m4: Use *vms* instead of vms*. 2012-04-03 12:07:28 +00:00
mt-alphaieee
mt-d30v
mt-gnu
mt-mips16-compat
mt-mips-elfoabi
mt-mips-gnu
mt-ospace
mt-sde mt-sde: Change -mcode-xonly to -mcode-readable=pcrel. 2012-09-19 20:42:01 +00:00
mt-spu
multi.m4
nls.m4
no-executables.m4
override.m4
picflag.m4 picflag.m4 (m68k-*-*): Use default PIC flag. 2013-11-15 17:49:36 +00:00
plugins.m4
po.m4
proginstall.m4
progtest.m4
stdint_h.m4
stdint.m4 mt-sde: Fix typos. 2012-05-29 16:54:57 +01:00
tcl.m4 mt-sde: Fix typos. 2012-05-29 16:54:57 +01:00
tls.m4
uintmax_t.m4
ulonglong.m4
unwind_ipinfo.m4
warnings.m4
weakref.m4
zlib.m4