This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/63697] -fsanitize=undefined doesn't detect some subtraction overflows
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 31 Oct 2014 11:18:44 +0000
- Subject: [Bug sanitizer/63697] -fsanitize=undefined doesn't detect some subtraction overflows
- Auto-submitted: auto-generated
- References: <bug-63697-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63697
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Fri Oct 31 11:18:13 2014
New Revision: 216962
URL: https://gcc.gnu.org/viewcvs?rev=216962&root=gcc&view=rev
Log:
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.
Added:
trunk/gcc/testsuite/c-c++-common/ubsan/overflow-sub-3.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vrp.c