flag-types.h (enum sanitize_code): Add SANITIZE_BUILTIN.
authorJakub Jelinek <jakub@redhat.com>
Thu, 19 Oct 2017 12:09:52 +0000 (14:09 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 19 Oct 2017 12:09:52 +0000 (14:09 +0200)
commit07d7c611fc0c4be0a0be935efe97a7887e78bc2a
treedef604d8db44c55f5de1bb611ed83a32c753321d
parent5d3805fca3e9a199fbaa18aee3c05ecb30ebca61
flag-types.h (enum sanitize_code): Add SANITIZE_BUILTIN.

* 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.

From-SVN: r253888
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