changeset 59256:44aa31d0dea3

8234350: assert(mode == ControlAroundStripMined && (use == sfpt || !use->is_reachable_from_root())) failed: missed a node Reviewed-by: thartmann, mdoerr
author roland
date Mon, 09 Dec 2019 15:37:04 +0100
parents 3333517d634e
children 61446ba18984
files src/hotspot/share/opto/loopopts.cpp test/hotspot/jtreg/compiler/loopstripmining/DeadNodesInOuterLoopAtLoopCloning2.java
diffstat 2 files changed, 62 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/opto/loopopts.cpp	Tue Dec 10 07:07:49 2019 -0800
+++ b/src/hotspot/share/opto/loopopts.cpp	Mon Dec 09 15:37:04 2019 +0100
@@ -1727,7 +1727,8 @@
 #ifdef ASSERT
     if (loop->_head->as_Loop()->is_strip_mined() && outer_loop->is_member(use_loop) && !loop->is_member(use_loop) && old_new[use->_idx] == NULL) {
       Node* sfpt = loop->_head->as_CountedLoop()->outer_safepoint();
-      assert(mode == ControlAroundStripMined && (use == sfpt || !use->is_reachable_from_root()), "missed a node");
+      assert(mode != IgnoreStripMined, "incorrect cloning mode");
+      assert((mode == ControlAroundStripMined && use == sfpt) || !use->is_reachable_from_root(), "missed a node");
     }
 #endif
     if (!loop->is_member(use_loop) && !outer_loop->is_member(use_loop) && (!old->is_CFG() || !use->is_CFG())) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/loopstripmining/DeadNodesInOuterLoopAtLoopCloning2.java	Mon Dec 09 15:37:04 2019 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2019, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8234350
+ * @summary loop unrolling breaks when outer strip mined loop contains dead node
+ *
+ * @run main/othervm -Xcomp -XX:-TieredCompilation -XX:CompileOnly=DeadNodesInOuterLoopAtLoopCloning2 DeadNodesInOuterLoopAtLoopCloning2
+ *
+ */
+
+public class DeadNodesInOuterLoopAtLoopCloning2 {
+    public static void vMeth(boolean b, int i, float f) {
+        int i1=-4, i2=14, i16=10;
+        byte by=116;
+
+        for (i1 = 323; i1 > 3; i1 -= 2) {
+            if (i2 != 0) {
+                return;
+            }
+            for (i16 = 1; i16 < 10; i16++) {
+                i2 = by;
+                i += (i16 - i2);
+                i2 -= i16;
+                if (b) {
+                    i = by;
+                }
+                i2 *= 20;
+            }
+        }
+    }
+
+    public static void main(String[] strArr) {
+        DeadNodesInOuterLoopAtLoopCloning2 _instance = new DeadNodesInOuterLoopAtLoopCloning2();
+        for (int i = 0; i < 10; i++ ) {
+            _instance.vMeth(true, 168, -125.661F);
+        }
+    }
+}