re PR sanitizer/77823 (ICE: in ubsan_encode_value, at ubsan.c:137 with -fsanitize...
authorJakub Jelinek <jakub@redhat.com>
Wed, 16 Nov 2016 08:28:50 +0000 (09:28 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 16 Nov 2016 08:28:50 +0000 (09:28 +0100)
commit1705cebd79f24bc85dab766a9a26390827f26fa0
tree9fffaa05cb502bdcbfd169cbadc603c4b6d31f2a
parent00178b98eb609827f8e799931f55288ab2f58ee1
re PR sanitizer/77823 (ICE: in ubsan_encode_value, at ubsan.c:137 with -fsanitize=undefined and vector types)

PR sanitizer/77823
* ubsan.c (ubsan_build_overflow_builtin): Add DATAP argument, if
it points to non-NULL tree, use it instead of ubsan_create_data.
(instrument_si_overflow): Handle vector signed integer overflow
checking.
* ubsan.h (ubsan_build_overflow_builtin): Add DATAP argument.
* tree-vrp.c (simplify_internal_call_using_ranges): Punt for
vector IFN_UBSAN_CHECK_*.
* internal-fn.c (expand_addsub_overflow): Add DATAP argument,
pass it through to ubsan_build_overflow_builtin.
(expand_neg_overflow, expand_mul_overflow): Likewise.
(expand_vector_ubsan_overflow): New function.
(expand_UBSAN_CHECK_ADD, expand_UBSAN_CHECK_SUB,
expand_UBSAN_CHECK_MUL): Use tit for vector arithmetics.
(expand_arith_overflow): Adjust expand_*_overflow callers.

* c-c++-common/ubsan/overflow-vec-1.c: New test.
* c-c++-common/ubsan/overflow-vec-2.c: New test.

From-SVN: r242469
gcc/ChangeLog
gcc/internal-fn.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/ubsan/overflow-vec-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/ubsan/overflow-vec-2.c [new file with mode: 0644]
gcc/tree-vrp.c
gcc/ubsan.c
gcc/ubsan.h