Skip to content

Commit c5508ab

Browse files
franferraxgnu-andrew
authored andcommitted
8332644: Improve graph optimizations
Reviewed-by: mbalao, andrew Backport-of: 7c16d649a8118d2e7ee77cedba87e620c83294b4
1 parent da6b265 commit c5508ab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hotspot/src/share/vm/opto/loopnode.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ Node *LoopLimitNode::Ideal(PhaseGVN *phase, bool can_reshape) {
12201220

12211221
const TypeInt* init_t = phase->type(in(Init) )->is_int();
12221222
const TypeInt* limit_t = phase->type(in(Limit))->is_int();
1223-
int stride_p;
1223+
jlong stride_p;
12241224
jlong lim, ini;
12251225
julong max;
12261226
if (stride_con > 0) {
@@ -1229,10 +1229,10 @@ Node *LoopLimitNode::Ideal(PhaseGVN *phase, bool can_reshape) {
12291229
ini = init_t->_lo;
12301230
max = (julong)max_jint;
12311231
} else {
1232-
stride_p = -stride_con;
1232+
stride_p = -(jlong)stride_con;
12331233
lim = init_t->_hi;
12341234
ini = limit_t->_lo;
1235-
max = (julong)min_jint;
1235+
max = (julong)(juint)min_jint; // double cast to get 0x0000000080000000, not 0xffffffff80000000
12361236
}
12371237
julong range = lim - ini + stride_p;
12381238
if (range <= max) {

0 commit comments

Comments
 (0)