Skip to content

Commit 33c94ff

Browse files
committed
8263376: CTW (Shenandoah): assert(mems <= 1) failed: No node right after call if multiple mem projections
Reviewed-by: kvn, chagedorn
1 parent 4e74de4 commit 33c94ff

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

src/hotspot/share/opto/loopnode.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5042,7 +5042,8 @@ Node *PhaseIdealLoop::get_late_ctrl( Node *n, Node *early ) {
50425042
for (uint j = 1; j < s->req(); j++) {
50435043
Node* in = s->in(j);
50445044
Node* r_in = r->in(j);
5045-
if ((worklist.member(in) || in == mem) && is_dominator(early, r_in)) {
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)) {
50465047
LCA = dom_lca_for_get_late_ctrl(LCA, r_in, n);
50475048
}
50485049
}

test/hotspot/jtreg/gc/shenandoah/compiler/TestBadRawMemoryAfterCall.java

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/**
2525
* @test
26-
* @bug 8258393
26+
* @bug 8258393 8263376
2727
* @summary Shenandoah: "graph should be schedulable" assert failure
2828
* @requires vm.flavor == "server"
2929
* @requires vm.gc.Shenandoah
@@ -38,13 +38,17 @@ public static void main(String[] args) {
3838
B b = new B();
3939
C c = new C();
4040
for (int i = 0; i < 20_000; i++) {
41-
test(a);
42-
test(b);
43-
test(c);
41+
test1(a);
42+
test1(b);
43+
test1(c);
44+
45+
test2(a, i);
46+
test2(b, i);
47+
test2(c, i);
4448
}
4549
}
4650

47-
private static Object test(A a) {
51+
private static Object test1(A a) {
4852
if (a.getClass() == A.class) {
4953
}
5054

@@ -58,6 +62,25 @@ private static Object test(A a) {
5862
return o;
5963
}
6064

65+
static int field;
66+
67+
private static Object test2(A a, int i) {
68+
if (a.getClass() == A.class) {
69+
}
70+
71+
Object o = null;
72+
try {
73+
a.m();
74+
o = a.getClass();
75+
} catch (Exception e) {
76+
i = 42;
77+
}
78+
if (i == 42) {
79+
field = 42;
80+
}
81+
return o;
82+
}
83+
6184
private static class A {
6285
void m() throws Exception {
6386
throw new Exception();

0 commit comments

Comments
 (0)