Skip to content
Permalink
Browse files
8260637: Shenandoah: assert(_base == Tuple) failure during C2 compila…
…tion

Reviewed-by: chagedorn, kvn
  • Loading branch information
rwestrel committed Feb 23, 2021
1 parent 67762de commit 8a2f58907c967d3f736e0473cbcd29cb5aa06b16
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
@@ -5301,7 +5301,7 @@ void PhaseIdealLoop::build_loop_late_post_work(Node *n, bool pinned) {
case Op_HasNegatives:
pinned = false;
}
if (n->is_CMove()) {
if (n->is_CMove() || n->is_ConstraintCast()) {
pinned = false;
}
if( pinned ) {
@@ -23,7 +23,7 @@

/**
* @test
* @bug 8237007
* @bug 8237007 8260637
* @summary Shenandoah: assert(_base == Tuple) failure during C2 compilation
* @requires vm.flavor == "server"
* @requires vm.gc.Shenandoah
@@ -33,18 +33,19 @@
*/

public class LRBRightAfterMemBar {
private static Object field1;
private static A field1;
private static Object field2;
static volatile int barrier;

public static void main(String[] args) {
for (int i = 0; i < 20_000; i++) {
test(true, true, new Object());
test(false, false, new Object());
test1(true, true, new Object());
test1(false, false, new Object());
test2(new Object(), 0, 10);
}
}

private static Object test(boolean flag, boolean flag2, Object o2) {
private static Object test1(boolean flag, boolean flag2, Object o2) {
for (int i = 0; i < 10; i++) {
barrier = 0x42; // Membar
if (o2 == null) { // hoisted out of loop
@@ -61,4 +62,30 @@ private static Object test(boolean flag, boolean flag2, Object o2) {

return null;
}

private static int test2(Object o2, int start, int stop) {
A a1 = null;
A a2 = null;
int v = 0;
for (int i = start; i < stop; i++) {
a2 = new A();
a1 = new A();
a1.a = a2;
barrier = 0x42; // Membar
if (o2 == null) { // hoisted out of loop
}
A a3 = a1.a;
v = a3.f; // null check optimized out by EA but CastPP left in
}

a1.f = 0x42;
a2.f = 0x42;

return v;
}

static class A {
A a;
int f;
}
}

1 comment on commit 8a2f589

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 8a2f589 Feb 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.