Skip to content

Commit

Permalink
8313689: C2: compiler/c2/irTests/scalarReplacement/AllocationMergesTe…
Browse files Browse the repository at this point in the history
…sts.java fails intermittently with -XX:-TieredCompilation

Reviewed-by: kvn, thartmann
  • Loading branch information
Cesar Soares Lucas authored and TobiHartmann committed Aug 22, 2023
1 parent ab86d23 commit 02ef859
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public static void main(String[] args) {
"-XX:+ReduceAllocationMerges",
"-XX:+TraceReduceAllocationMerges",
"-XX:+DeoptimizeALot",
"-XX:CompileCommand=inline,*::charAt*",
"-XX:CompileCommand=inline,*PicturePositions::*",
"-XX:CompileCommand=inline,*Point::*",
"-XX:CompileCommand=exclude,*::dummy*");
}

Expand Down Expand Up @@ -92,9 +95,11 @@ public static void main(String[] args) {
"testString_two_C2"
})
public void runner(RunInfo info) {
invocations++;

Random random = info.getRandom();
boolean cond1 = random.nextBoolean();
boolean cond2 = random.nextBoolean();
boolean cond1 = invocations % 2 == 0;
boolean cond2 = !cond1;

int l = random.nextInt();
int w = random.nextInt();
Expand Down Expand Up @@ -551,9 +556,10 @@ int testSubclassesTrapping(boolean c1, boolean c2, int x, int y, int w, int z) {
new F();
}

int res = s.a;
dummy();

return s.a;
return res;
}

@Test
Expand Down Expand Up @@ -1196,12 +1202,13 @@ int testSRAndNSR_Trap(boolean is_c2, boolean cond1, boolean cond2, int x, int y)
global_escape = p;
}

int res = p.x;
if (is_c2) {
// This will show up to C2 as a trap.
dummy_defaults();
}

return p.y;
return res;
}

@Test
Expand Down

1 comment on commit 02ef859

@openjdk-notifier
Copy link

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.