changeset 54590:195309a6c7d5

8219517: assert(false) failed: infinite loop in PhaseIterGVN::optimize Reviewed-by: kvn, thartmann
author neliasso
date Wed, 13 Mar 2019 15:22:28 +0100
parents 1a6a5a0260a7
children fab8496eb541
files src/hotspot/share/opto/memnode.cpp
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/opto/memnode.cpp	Wed Mar 13 07:16:57 2019 -0700
+++ b/src/hotspot/share/opto/memnode.cpp	Wed Mar 13 15:22:28 2019 +0100
@@ -1394,6 +1394,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
         }