changeset 9035:bd6ec847115e

8219517: assert(false) failed: infinite loop in PhaseIterGVN::optimize Reviewed-by: kvn, thartmann
author neliasso
date Mon, 19 Aug 2019 17:36:36 +0200
parents 25738d7267c3
children 940791dabea2
files src/share/vm/opto/memnode.cpp
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/memnode.cpp	Wed May 01 20:25:31 2019 -0700
+++ b/src/share/vm/opto/memnode.cpp	Mon Aug 19 17:36:36 2019 +0200
@@ -1359,6 +1359,14 @@
         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
         }