From f83c5cf53e6635fe88ebc5a0597ad7b5f5069fbe Mon Sep 17 00:00:00 2001 From: neliasso Date: Mon, 19 Aug 2019 17:36:36 +0200 Subject: [PATCH] 8219517: assert(false) failed: infinite loop in PhaseIterGVN::optimize Reviewed-by: kvn, thartmann --HG-- extra : rebase_source : e1af5b86db38ac1b7ed27b4f39be267bb8b27d0e --- src/share/vm/opto/memnode.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/share/vm/opto/memnode.cpp b/src/share/vm/opto/memnode.cpp index 14b0ff9a9..590111a39 100644 --- a/src/share/vm/opto/memnode.cpp +++ b/src/share/vm/opto/memnode.cpp @@ -1359,6 +1359,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 } -- GitLab