gcc/libsanitizer/ubsan
Marek Polacek 85a16bf8b5 builtins.def: Change SANITIZE_FLOAT_DIVIDE to SANITIZE_NONDEFAULT.
* builtins.def: Change SANITIZE_FLOAT_DIVIDE to SANITIZE_NONDEFAULT.
	* gcc.c (sanitize_spec_function): Likewise.
	* convert.c (convert_to_integer): Include "ubsan.h".  Add
	floating-point to integer instrumentation.
	* doc/invoke.texi: Document -fsanitize=float-cast-overflow.
	* flag-types.h (enum sanitize_code): Add SANITIZE_FLOAT_CAST and
	SANITIZE_NONDEFAULT.
	* opts.c (common_handle_option): Handle -fsanitize=float-cast-overflow.
	* sanitizer.def (BUILT_IN_UBSAN_HANDLE_FLOAT_CAST_OVERFLOW,
	BUILT_IN_UBSAN_HANDLE_FLOAT_CAST_OVERFLOW_ABORT): Add.
	* ubsan.c: Include "realmpfr.h" and "dfp.h".
	(get_ubsan_type_info_for_type): Handle REAL_TYPEs.
	(ubsan_type_descriptor): Set tkind to 0xffff for types other than
	float/double/long double.
	(ubsan_instrument_float_cast): New function.
	* ubsan.h (ubsan_instrument_float_cast): Declare.
testsuite/
	* c-c++-common/ubsan/float-cast-overflow-1.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-10.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-2.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-3.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-4.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-5.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-6.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-7.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-7.h: New file.
	* c-c++-common/ubsan/float-cast-overflow-8.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-9.c: New test.
	* c-c++-common/ubsan/float-cast.h: New file.
	* g++.dg/ubsan/float-cast-overflow-bf.C: New test.
	* gcc.dg/ubsan/float-cast-overflow-bf.c: New test.
libsanitizer/
	* ubsan/ubsan_value.cc (getFloatValue): Handle 96-bit
	floating-point types.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r210862
2014-05-23 14:44:42 +00:00
..
Makefile.am re PR sanitizer/59136 (llvm-symbolizer shouldn't be started always) 2014-01-09 19:13:39 +01:00
Makefile.in re PR sanitizer/59136 (llvm-symbolizer shouldn't be started always) 2014-01-09 19:13:39 +01:00
libtool-version Merge ubsan into trunk. 2013-08-30 16:12:58 +00:00
ubsan_diag.cc libsanitizer merge from upstream r209283 2014-05-22 07:09:21 +00:00
ubsan_diag.h libsanitizer merge from upstream r196090 2013-12-05 09:18:38 +00:00
ubsan_handlers.cc libsanitizer merge from upstream r196090 2013-12-05 09:18:38 +00:00
ubsan_handlers.h libsanitizer merge from upstream r196090 2013-12-05 09:18:38 +00:00
ubsan_handlers_cxx.cc Merge ubsan into trunk. 2013-08-30 16:12:58 +00:00
ubsan_handlers_cxx.h Merge ubsan into trunk. 2013-08-30 16:12:58 +00:00
ubsan_type_hash.cc libsanitizer merge from upstream r196090 2013-12-05 09:18:38 +00:00
ubsan_type_hash.h Merge ubsan into trunk. 2013-08-30 16:12:58 +00:00
ubsan_value.cc builtins.def: Change SANITIZE_FLOAT_DIVIDE to SANITIZE_NONDEFAULT. 2014-05-23 14:44:42 +00:00
ubsan_value.h libsanitizer merge from upstream r209283 2014-05-22 07:09:21 +00:00