8259430: C2: assert(in_vt->length() == out_vt->length()) failed: mismatch on number of elements

Reviewed-by: kvn, thartmann
This commit is contained in:
Vladimir Ivanov 2021-02-11 10:16:09 +00:00
parent 1662373400
commit 3ede231dec
2 changed files with 20 additions and 16 deletions

View File

@ -1225,7 +1225,8 @@ Node* VectorUnboxNode::Ideal(PhaseGVN* phase, bool can_reshape) {
ciKlass* vbox_klass = vbox->box_type()->klass();
const TypeVect* in_vt = vbox->vec_type();
const TypeVect* out_vt = type()->is_vect();
assert(in_vt->length() == out_vt->length(), "mismatch on number of elements");
if (in_vt->length() == out_vt->length()) {
Node* value = vbox->in(VectorBoxNode::Value);
bool is_vector_mask = vbox_klass->is_subclass_of(ciEnv::current()->vector_VectorMask_klass());
@ -1243,7 +1244,11 @@ Node* VectorUnboxNode::Ideal(PhaseGVN* phase, bool can_reshape) {
return new VectorLoadShuffleNode(value, out_vt);
}
} else {
assert(false, "type mismatch on vector: %s", vbox_klass->name()->as_utf8());
// Vector type mismatch is only supported for masks and shuffles, but sometimes it happens in pathological cases.
}
} else {
// Vector length mismatch.
// Sometimes happen in pathological cases (e.g., when unboxing happens in effectively dead code).
}
}
}

View File

@ -29,4 +29,3 @@
java/lang/invoke/MethodHandles/CatchExceptionTest.java 8146623 generic-all
java/util/stream/test/org/openjdk/tests/java/util/stream/SpliteratorTest.java 8256368 generic-all
jdk/incubator/vector/VectorHash.java 8259430 generic-all