re PR sanitizer/81125 (-fsanitize=undefined ICE)
authorJakub Jelinek <jakub@redhat.com>
Mon, 19 Jun 2017 15:28:42 +0000 (17:28 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 19 Jun 2017 15:28:42 +0000 (17:28 +0200)
commit9f8fafe847daf2c1bc1721d6d97203686567549d
treee6c468ee35c19ea0a9cb1656e84f32b1a10c0fa0
parent4301ae2263d214d1c4b8e5d3d210e0aafff19e47
re PR sanitizer/81125 (-fsanitize=undefined ICE)

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.

* g++.dg/ubsan/pr81125.C: New test.

From-SVN: r249376
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ubsan/pr81125.C [new file with mode: 0644]
gcc/ubsan.c
gcc/ubsan.h