re PR tree-optimization/79095 (spurious stringop-overflow warning)
authorJeff Law <law@redhat.com>
Tue, 14 Feb 2017 15:54:09 +0000 (08:54 -0700)
committerJeff Law <law@gcc.gnu.org>
Tue, 14 Feb 2017 15:54:09 +0000 (08:54 -0700)
commit6c022f732a934b61ab3fc7312bd3f2fc725d4223
treefc8cb29f5b36c3e8ce30d82c136db0ddb8829764
parentc145a51018565e5e2fa61701998336a60911f849
re PR tree-optimization/79095 (spurious stringop-overflow warning)

PR tree-optimization/79095
* tree-vrp.c (extract_range_from_binary_expr_1): For EXACT_DIV_EXPR,
if the numerator has the range ~[0,0] make the resultant range ~[0,0].
(extract_range_from_binary_expr): For MINUS_EXPR with no derived range,
if the operands are known to be not equal, then the resulting range
is ~[0,0].
(intersect_ranges): If the new range is ~[0,0] and the old range is
wide, then prefer ~[0,0].
* tree-vrp.c (overflow_comparison_p_1): New function.
(overflow_comparison_p): New function.
* tree-vrp.c (register_edge_assert_for_2): Register additional asserts
if NAME is used in an overflow test.
(vrp_evaluate_conditional_warnv_with_ops): If the ops represent an
overflow check that can be expressed as an equality test, then adjust
ops to be that equality test.

PR tree-optimization/79095
* g++.dg/pr79095-1.C: New test
* g++.dg/pr79095-2.C: New test
* g++.dg/pr79095-3.C: New test
* g++.dg/pr79095-4.C: New test
* g++.dg/pr79095-5.C: New test
* gcc.c-torture/execute/arith-1.c: Update with more cases.
* gcc.dg/tree-ssa/pr79095-1.c: New test.

From-SVN: r245434
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr79095-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/pr79095-2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/pr79095-3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/pr79095-4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/pr79095-5.C [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/arith-1.c
gcc/testsuite/gcc.dg/tree-ssa/pr79095.c [new file with mode: 0644]
gcc/tree-vrp.c