summaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-30 16:12:58 +0000
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-30 16:12:58 +0000
commit9e46467d67ba5ff4a10318b505879dcb15418636 (patch)
tree23d42aa647cb7a2de96792b724ecaaddee3423fa /gcc/builtins.c
parent95bf5b605b129d86d39ac9a10338bbaaab32d631 (diff)
downloadlinaro-gcc-9e46467d67ba5ff4a10318b505879dcb15418636.tar.gz
linaro-gcc-9e46467d67ba5ff4a10318b505879dcb15418636.tar.bz2
linaro-gcc-9e46467d67ba5ff4a10318b505879dcb15418636.zip
Merge ubsan into trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202113 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index d8baad15e8e..92aec31ab47 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see
#include "value-prof.h"
#include "diagnostic-core.h"
#include "builtins.h"
+#include "ubsan.h"
#ifndef PAD_VARARGS_DOWN
@@ -10303,6 +10304,11 @@ fold_builtin_0 (location_t loc, tree fndecl, bool ignore ATTRIBUTE_UNUSED)
case BUILT_IN_CLASSIFY_TYPE:
return fold_builtin_classify_type (NULL_TREE);
+ case BUILT_IN_UNREACHABLE:
+ if (flag_sanitize & SANITIZE_UNREACHABLE)
+ return ubsan_instrument_unreachable (loc);
+ break;
+
default:
break;
}