JDK-8147853 : "assert(t->meet(t0) == t) failed: Not monotonic" with sun/util/calendar/zi/TestZoneInfo310.java
Type:Bug
Component:hotspot
Sub-Component:compiler
Affected Version:9
Priority:P4
Status:Resolved
Resolution:Fixed
Submitted:2016-01-20
Updated:2016-02-11
Resolved:2016-01-26
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
JDK-8145322 causes sun/util/calendar/zi/TestZoneInfo310.java with:
assert(t->meet(t0) == t) failed: Not monotonic
Undoing the change from PhiNode::Value() causes the failure to disappear.
Comments
During CCP, a Phi for the induction variable of a CountedLoop is processed repeatedly while the type of the backedge control is top so only the loop entry input is considered for computing the Phi���s type.
The loop entry first has type int:1..3 so the Phi���s type is int:1..3
then it has type int:1..4 so the Phi���s type is int:1..4
then it has type int:1..5:www so the Phi���s type is int:1..5:www
then it has type int:1..6:www so the Phi���s type is saturated to int:1..max-1:www
The backedge control���s type is changed to non-top and the type of the Phi is recomputed. This time the special code for counted loop in PhiNode::Value():
CountedLoopNode* l = r->is_CountedLoop() ? r->as_CountedLoop() : NULL;
if (l && l->can_be_counted_loop(phase) &&
((const Node*)l->phi() == this)) { // Trip counted loop!
// protect against init_trip() or limit() returning NULL
const Node *init = l->init_trip();
const Node *limit = l->limit();
const Node* stride = l->stride();
if (init != NULL && limit != NULL && stride != NULL) {
const TypeInt* lo = phase->type(init)->isa_int();
const TypeInt* hi = phase->type(limit)->isa_int();
const TypeInt* stride_t = phase->type(stride)->isa_int();
if (lo != NULL && hi != NULL && stride_t != NULL) { // Dying loops might have TOP here
assert(stride_t->_hi >= stride_t->_lo, "bad stride type");
const Type* res = NULL;
if (stride_t->_hi < 0) { // Down-counter loop
swap(lo, hi);
return TypeInt::make(MIN2(lo->_lo, hi->_lo) , hi->_hi, 3);
} else if (stride_t->_lo >= 0) {
return TypeInt::make(lo->_lo, MAX2(lo->_hi, hi->_hi), 3);
}
}
}
}
kicks in and it computes a type of: int:1..8:www. The type of the Phi was narrowed and the assert fires.
26-01-2016
regarding lack of test case: processing order of nodes during CCP matter and is hard to control from a test case