PR tree-optimization/79095
commit37735e018a1a175d0afcbc32af965a77941f5112
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Feb 2017 15:54:09 +0000 (14 15:54 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Feb 2017 15:54:09 +0000 (14 15:54 +0000)
treefc8cb29f5b36c3e8ce30d82c136db0ddb8829764
parentf9378734e145a9384fe8957ea76b33a65f83d113
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245434 138bc75d-0d04-0410-961f-82ee72b054a4
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