mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
7052494: Eclipse test fails on JDK 7 b142
Keep 'ne' test in Counted loop when we can't guarantee during compilation that init < limit. Reviewed-by: never
This commit is contained in:
parent
5d2e4e676b
commit
d19a8f6e35
3 changed files with 172 additions and 3 deletions
|
@ -453,7 +453,12 @@ bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) {
|
|||
// Now we need to canonicalize loop condition.
|
||||
if (bt == BoolTest::ne) {
|
||||
assert(stride_con == 1 || stride_con == -1, "simple increment only");
|
||||
bt = (stride_con > 0) ? BoolTest::lt : BoolTest::gt;
|
||||
// 'ne' can be replaced with 'lt' only when init < limit.
|
||||
if (stride_con > 0 && init_t->_hi < limit_t->_lo)
|
||||
bt = BoolTest::lt;
|
||||
// 'ne' can be replaced with 'gt' only when init > limit.
|
||||
if (stride_con < 0 && init_t->_lo > limit_t->_hi)
|
||||
bt = BoolTest::gt;
|
||||
}
|
||||
|
||||
if (incl_limit) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue