8219517: assert(false) failed: infinite loop in PhaseIterGVN::optimize

Reviewed-by: kvn, thartmann
This commit is contained in:
Nils Eliasson 2019-03-13 15:22:28 +01:00
parent b5783d5055
commit 1057f7e2a7

View File

@ -1394,6 +1394,14 @@ Node *LoadNode::split_through_phi(PhaseGVN *phase) {
Node* in = mem->in(i);
Node* m = optimize_memory_chain(in, t_oop, this, phase);
if (m == mem) {
if (i == 1) {
// if the first edge was a loop, check second edge too.
// If both are replaceable - we are in an infinite loop
Node *n = optimize_memory_chain(mem->in(2), t_oop, this, phase);
if (n == mem) {
break;
}
}
set_req(Memory, mem->in(cnt - i));
return this; // made change
}