[ubsan] Fix ICE
While we have a current_function_decl in this case,
still create_tmp_var's called gimple_add_tmp_var and
mark_addressable don't work too well when the current
function is a C++ ctor or dtor that the FE then duplicates
2017-06-27 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/81209
* ubsan.c (ubsan_encode_value): Initialize DECL_CONTEXT on var.
* g++.dg/ubsan/pr81209.C: New test.
2017-06-20 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/81125
* ubsan.h (ubsan_encode_value): Workaround buggy clang++ parser
by removing enum keyword.
(ubsan_type_descriptor): Likewise. Formatting fix.
2017-06-19 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/81125
* ubsan.h (enum ubsan_encode_value_phase): New.
(ubsan_encode_value): Change second argument to
enum ubsan_encode_value_phase with default value of
UBSAN_ENCODE_VALUE_GENERIC.
* ubsan.c (ubsan_encode_value): Change second argument to
enum ubsan_encode_value_phase PHASE from bool IN_EXPAND_P,
adjust uses, for UBSAN_ENCODE_VALUE_GENERIC use just
create_tmp_var_raw instead of create_tmp_var and use a
TARGET_EXPR.
(ubsan_expand_bounds_ifn, ubsan_build_overflow_builtin,
instrument_bool_enum_load, ubsan_instrument_float_cast): Adjust
ubsan_encode_value callers.
PR sanitizer/81111
* ubsan.c (ubsan_encode_value): If current_function_decl is NULL,
use create_tmp_var_raw instead of create_tmp_var, mark it addressable
just by setting TREE_ADDRESSABLE on the result and use a TARGET_EXPR.
PR sanitizer/81125
* g++.dg/ubsan/pr81125.C: New test.
PR sanitizer/81111
* g++.dg/ubsan/pr81111.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@249480
138bc75d-0d04-0410-961f-
82ee72b054a4
Change-Id: I3b7816b4f9b1bb5916adf3684dcbcc5284e50954