Skip to content

Commit b6a9f5c

Browse files
committed
8307619: C2 failed: Not monotonic (AndI CastII LShiftI) in TestShiftCastAndNotification.java
Reviewed-by: chagedorn, thartmann
1 parent eaa80ad commit b6a9f5c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/hotspot/share/opto/mulnode.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -1923,13 +1923,15 @@ bool MulNode::AndIL_shift_and_mask_is_always_zero(PhaseGVN* phase, Node* shift,
19231923
if (mask == nullptr || shift == nullptr) {
19241924
return false;
19251925
}
1926+
const TypeInteger* mask_t = phase->type(mask)->isa_integer(bt);
1927+
if (mask_t == nullptr || phase->type(shift)->isa_integer(bt) == nullptr) {
1928+
return false;
1929+
}
19261930
shift = shift->uncast();
19271931
if (shift == nullptr) {
19281932
return false;
19291933
}
1930-
const TypeInteger* mask_t = phase->type(mask)->isa_integer(bt);
1931-
const TypeInteger* shift_t = phase->type(shift)->isa_integer(bt);
1932-
if (mask_t == nullptr || shift_t == nullptr) {
1934+
if (phase->type(shift)->isa_integer(bt) == nullptr) {
19331935
return false;
19341936
}
19351937
BasicType shift_bt = bt;
@@ -1946,6 +1948,9 @@ bool MulNode::AndIL_shift_and_mask_is_always_zero(PhaseGVN* phase, Node* shift,
19461948
if (val->Opcode() == Op_LShiftI) {
19471949
shift_bt = T_INT;
19481950
shift = val;
1951+
if (phase->type(shift)->isa_integer(bt) == nullptr) {
1952+
return false;
1953+
}
19491954
}
19501955
}
19511956
if (shift->Opcode() != Op_LShift(shift_bt)) {

0 commit comments

Comments
 (0)