* flag-types.h (enum sanitize_code): Add SANITIZE_BUILTIN. Or
commit21104a1367ae458bbc56efd8a8e6479e8baf7a88
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 19 Oct 2017 12:09:52 +0000 (19 12:09 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 19 Oct 2017 12:09:52 +0000 (19 12:09 +0000)
treedef604d8db44c55f5de1bb611ed83a32c753321d
parent36093749ff955d9e8cf208b04724c3a1a2ac9b04
* flag-types.h (enum sanitize_code): Add SANITIZE_BUILTIN.  Or
SANITIZE_BUILTIN into SANITIZE_UNDEFINED.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_INVALID_BUILTIN,
BUILT_IN_UBSAN_HANDLE_INVALID_BUILTIN_ABORT): New builtins.
* opts.c (sanitizer_opts): Add builtin.
* ubsan.c (instrument_builtin): New function.
(pass_ubsan::execute): Call it.
(pass_ubsan::gate): Enable even for SANITIZE_BUILTIN.
* doc/invoke.texi: Document -fsanitize=builtin.

* c-c++-common/ubsan/builtin-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253888 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/doc/invoke.texi
gcc/flag-types.h
gcc/opts.c
gcc/sanitizer.def
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/ubsan/builtin-1.c [new file with mode: 0644]
gcc/ubsan.c