--- a/hotspot/src/share/vm/opto/cfgnode.cpp Tue Mar 15 16:23:31 2016 +0300
+++ b/hotspot/src/share/vm/opto/cfgnode.cpp Tue Mar 15 17:42:28 2016 +0100
@@ -1665,7 +1665,7 @@
bool uncasted = false;
Node* uin = unique_input(phase, false);
- if (uin == NULL) {
+ if (uin == NULL && can_reshape) {
uncasted = true;
uin = unique_input(phase, true);
}
@@ -1702,6 +1702,8 @@
}
if (uncasted) {
+ // Wait until after parsing for the type information to propagate from the casts
+ assert(can_reshape, "Invalid during parsing");
const Type* phi_type = bottom_type();
assert(phi_type->isa_int() || phi_type->isa_ptr(), "bad phi type");
int opcode;
@@ -1720,8 +1722,9 @@
Node* cast = ConstraintCastNode::make_cast(opcode, r, uin, phi_type, true);
cast = phase->transform(cast);
// set all inputs to the new cast so the Phi is removed by Identity
+ PhaseIterGVN* igvn = phase->is_IterGVN();
for (uint i = 1; i < req(); i++) {
- set_req(i, cast);
+ set_req_X(i, cast, igvn);
}
uin = cast;
}