Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.

Commit df1364b

Browse files
committed
8269575: C2: assert(false) failed: graph should be schedulable after JDK-8252372
Reviewed-by: kvn, thartmann
1 parent 6d8fc72 commit df1364b

File tree

2 files changed

+88
-13
lines changed

2 files changed

+88
-13
lines changed

src/hotspot/share/opto/loopnode.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5033,19 +5033,19 @@ Node* PhaseIdealLoop::get_late_ctrl_with_anti_dep(LoadNode* n, Node* early, Node
50335033
}
50345034
}
50355035
}
5036-
// For Phis only consider Region's inputs that were reached by following the memory edges
5037-
if (LCA != early) {
5038-
for (uint i = 0; i < worklist.size(); i++) {
5039-
Node* s = worklist.at(i);
5040-
if (s->is_Phi() && C->can_alias(s->adr_type(), load_alias_idx)) {
5041-
Node* r = s->in(0);
5042-
for (uint j = 1; j < s->req(); j++) {
5043-
Node* in = s->in(j);
5044-
Node* r_in = r->in(j);
5045-
// We can't reach any node from a Phi because we don't enqueue Phi's uses above
5046-
if (((worklist.member(in) && !in->is_Phi()) || in == mem) && is_dominator(early, r_in)) {
5047-
LCA = dom_lca_for_get_late_ctrl(LCA, r_in, n);
5048-
}
5036+
}
5037+
// For Phis only consider Region's inputs that were reached by following the memory edges
5038+
if (LCA != early) {
5039+
for (uint i = 0; i < worklist.size(); i++) {
5040+
Node* s = worklist.at(i);
5041+
if (s->is_Phi() && C->can_alias(s->adr_type(), load_alias_idx)) {
5042+
Node* r = s->in(0);
5043+
for (uint j = 1; j < s->req(); j++) {
5044+
Node* in = s->in(j);
5045+
Node* r_in = r->in(j);
5046+
// We can't reach any node from a Phi because we don't enqueue Phi's uses above
5047+
if (((worklist.member(in) && !in->is_Phi()) || in == mem) && is_dominator(early, r_in)) {
5048+
LCA = dom_lca_for_get_late_ctrl(LCA, r_in, n);
50495049
}
50505050
}
50515051
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
* Copyright (c) 2021, Red Hat, Inc. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
24+
/**
25+
* @test
26+
* @bug 8269575
27+
* @summary C2: assert(false) failed: graph should be schedulable after JDK-8252372
28+
*
29+
* @run main/othervm -Xcomp -XX:CompileOnly=TestSunkNodeDueToBrokenAntiDependency TestSunkNodeDueToBrokenAntiDependency
30+
*
31+
*/
32+
33+
public class TestSunkNodeDueToBrokenAntiDependency {
34+
35+
public static final int N = 400;
36+
37+
public static volatile long instanceCount=-154L;
38+
public volatile int iArrFld[]=new int[N];
39+
40+
public void mainTest() {
41+
42+
int i8=8, i9=-3, i10=-199, i11=13, i12=8, i13=2;
43+
long lArr1[]=new long[N];
44+
45+
for (int i7 : iArrFld) {
46+
for (i8 = 1; i8 < 63; ++i8) {
47+
i10 = 1;
48+
while (++i10 < 2) {
49+
i7 += (int)instanceCount;
50+
lArr1[i10 + 1] -= 3;
51+
}
52+
i11 = 2;
53+
do {
54+
byte by2=-104;
55+
by2 = (byte)instanceCount;
56+
} while (--i11 > 0);
57+
i9 <<= 6;
58+
for (i12 = i8; 2 > i12; i12++) {
59+
switch (((i11 >>> 1) % 1) + 66) {
60+
case 66:
61+
instanceCount -= i13;
62+
break;
63+
}
64+
65+
}
66+
}
67+
}
68+
}
69+
public static void main(String[] strArr) {
70+
TestSunkNodeDueToBrokenAntiDependency _instance = new TestSunkNodeDueToBrokenAntiDependency();
71+
for (int i = 0; i < 10; i++ ) {
72+
_instance.mainTest();
73+
}
74+
}
75+
}

0 commit comments

Comments
 (0)