PR sanitizer/83219
* tree-cfg.c: Include asan.h.
(gimple_seq_unreachable_p): Return false for -fsanitize=unreachable.
From-SVN: r255295
+2017-12-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/83219
+ * tree-cfg.c: Include asan.h.
+ (gimple_seq_unreachable_p): Return false for -fsanitize=unreachable.
+
2017-12-01 Sergey Shalnov <Sergey.Shalnov@intel.com>
* config/i386/i386.md: Fix AVX512 register width in AVX512 instruction.
#include "attribs.h"
#include "selftest.h"
#include "opts.h"
+#include "asan.h"
/* This file contains functions for building the Control Flow Graph (CFG)
for a function tree. */
bool
gimple_seq_unreachable_p (gimple_seq stmts)
{
- if (stmts == NULL)
+ if (stmts == NULL
+ /* Return false if -fsanitize=unreachable, we don't want to
+ optimize away those calls, but rather turn them into
+ __ubsan_handle_builtin_unreachable () or __builtin_trap ()
+ later. */
+ || sanitize_flags_p (SANITIZE_UNREACHABLE))
return false;
gimple_stmt_iterator gsi = gsi_last (stmts);