8256478: C2 compilation fails with assert(t1->isa_long()) failed: Type must be a long

Reviewed-by: roland, chagedorn, kvn
This commit is contained in:
Tobias Hartmann 2020-11-18 11:52:47 +00:00
parent f7f3447496
commit 5bcf898b97

@ -1490,13 +1490,13 @@ const Type* RotateLeftNode::Value(PhaseGVN* phase) const {
}
Node* RotateLeftNode::Ideal(PhaseGVN *phase, bool can_reshape) {
const Type *t1 = phase->type(in(1));
const Type *t2 = phase->type(in(2));
const Type* t1 = phase->type(in(1));
const Type* t2 = phase->type(in(2));
if (t2->isa_int() && t2->is_int()->is_con()) {
if (t1->isa_int()) {
int lshift = t2->is_int()->get_con() & 31;
return new RotateRightNode(in(1), phase->intcon(32 - (lshift & 31)), TypeInt::INT);
} else {
} else if (t1 != Type::TOP) {
assert(t1->isa_long(), "Type must be a long");
int lshift = t2->is_int()->get_con() & 63;
return new RotateRightNode(in(1), phase->intcon(64 - (lshift & 63)), TypeLong::LONG);