re PR sanitizer/63697 (-fsanitize=undefined doesn't detect some subtraction overflows)
authorJakub Jelinek <jakub@redhat.com>
Fri, 31 Oct 2014 11:18:13 +0000 (12:18 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 31 Oct 2014 11:18:13 +0000 (12:18 +0100)
commitc288810f69853733df4452f25b78baaae0350a6c
treeff9d28eec53e7130189a016c309bdf94e61e8086
parent6fd52b789342ed9e37869891e07cd445b8f3e0bd
re PR sanitizer/63697 (-fsanitize=undefined doesn't detect some subtraction overflows)

PR sanitizer/63697
* tree-vrp.c (simplify_internal_call_using_ranges): For subcode ==
MINUS_EXPR, check overflow on vr0.min - vr1.max and vr0.max - vr1.min
instead of vr0.min - vr1.min and vr0.max - vr1.max.

* c-c++-common/ubsan/overflow-sub-3.c: New test.

From-SVN: r216962
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/ubsan/overflow-sub-3.c [new file with mode: 0644]
gcc/tree-vrp.c