re PR tree-optimization/30317 (VRP cannot extract a range from (unsigned int) i ...
authorRichard Guenther <rguenther@suse.de>
Fri, 28 Mar 2008 12:20:09 +0000 (12:20 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 28 Mar 2008 12:20:09 +0000 (12:20 +0000)
commit2ab8dbf48ee7c2eba910ee25ee37afd40e259738
tree7e98fd147828149c3866ab6ab9ae3e7ddbd75173
parentb0be8e5c63c8c89cf57b42566306c22b6654fda8
re PR tree-optimization/30317 (VRP cannot extract a range from (unsigned int) i + 0x0ffffffff > 4)

2008-03-28  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/30317
PR tree-optimization/30911
PR tree-optimization/34793
* tree-vrp.c (set_and_canonicalize_value_range): New function.
(struct assert_locus_d): New member EXPR.
(register_new_assert_for): Add EXPR parameter to support
ASSERT_EXPR <name, expr OP limit>.
(register_edge_assert_for_1): Adjust callers.
(find_assert_locations): Likewise.
(process_assert_insertions_for): Build condition from
expression.
(extract_range_from_assert): Handle ASSERT_EXPRs
of the form ASSERT_EXPR <name, expr OP limit>.
(register_edge_assert_for_2): New helper registering
asserts for comparisons.  Recognize range tests of the form
(unsigned)i - CST1 OP CST2.
(register_edge_assert_for_1): Use it.
(register_edge_assert_for): Likewise.
* tree.def (ASSERT_EXPR): Document extra allowed conditional
expressions.
(needs_overflow_infinity): Integer sub-types
do not need overflow infinities.
(vrp_val_is_max): The extreme values of integer sub-types
are those of the base type.
(vrp_val_is_min): Likewise.

* gcc.dg/tree-ssa/vrp35.c: New testcase.
* gcc.dg/tree-ssa/vrp36.c: Likewise.
* gcc.dg/tree-ssa/vrp37.c: Likewise.

From-SVN: r133680
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/vrp35.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/vrp36.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/vrp37.c [new file with mode: 0644]
gcc/tree-vrp.c
gcc/tree.def