diff --git a/src/share/vm/opto/connode.cpp b/src/share/vm/opto/connode.cpp index 00aee5102ee71c7d8b044c891cebfed434abea16..3d992498913d4b579f0af11bc1ecf64cd550114a 100644 --- a/src/share/vm/opto/connode.cpp +++ b/src/share/vm/opto/connode.cpp @@ -446,7 +446,9 @@ uint CastIINode::size_of() const { } uint CastIINode::cmp(const Node &n) const { - return TypeNode::cmp(n) && ((CastIINode&)n)._carry_dependency == _carry_dependency; + return TypeNode::cmp(n) && + ((CastIINode&)n)._carry_dependency == _carry_dependency && + ((CastIINode&)n)._range_check_dependency == _range_check_dependency; } Node *CastIINode::Identity(PhaseTransform *phase) { @@ -523,7 +525,7 @@ const Type *CastIINode::Value(PhaseTransform *phase) const { } Node *CastIINode::Ideal_DU_postCCP(PhaseCCP *ccp) { - if (_carry_dependency) { + if (_carry_dependency || _range_check_dependency) { return NULL; } return ConstraintCastNode::Ideal_DU_postCCP(ccp); diff --git a/src/share/vm/opto/subnode.cpp b/src/share/vm/opto/subnode.cpp index 1e6c06103d725fc5b29ca22bce65a2a700944585..303d333ef6068da67b3a7bc3a6fa20c2e528e8b4 100644 --- a/src/share/vm/opto/subnode.cpp +++ b/src/share/vm/opto/subnode.cpp @@ -547,8 +547,12 @@ const Type *CmpUNode::sub( const Type *t1, const Type *t2 ) const { // All unsigned values are LE -1 and GE 0. if (lo0 == 0 && hi0 == 0) { return TypeInt::CC_LE; // 0 <= bot + } else if ((jint)lo0 == -1 && (jint)hi0 == -1) { + return TypeInt::CC_GE; // -1 >= bot } else if (lo1 == 0 && hi1 == 0) { return TypeInt::CC_GE; // bot >= 0 + } else if ((jint)lo1 == -1 && (jint)hi1 == -1) { + return TypeInt::CC_LE; // bot <= -1 } } else { // We can use ranges of the form [lo..hi] if signs are the same.