You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a JIT bug where Graal gives a different output from the interpreter or HotSpot's C1/C2 compiler only when the background compilations are disabled.
Steps to reproduce the issue
javac T.java
java -Xint T
java T
java -XX:-BackgroundCompilation T
The results of aaa and bbb are different, while expected to be the same.
Describe GraalVM and your environment:
GraalVM version: 22.3.0-dev
JDK major version: 11.0.16
OS: Ubuntu 20.04
Architecture: x86_64
More details
The following is the source of our tests:
classT {
longa;
voidc() {}
voidz() {
inti, j, q = 40574, v;
doublem = 2.51479;
j = 1;
while (++j < 139) {
for (intw = 0; w < 5618; w += 1) c();
v = 1;
dom -= 0.853F;
while (++v < 2);
q = j;
q &= v;
}
a += q;
}
voidf() {
z();
System.out.println(a);
}
publicstaticvoidmain(String[] g) {
Tt = newT();
t.f();
}
}
Result of the interpreter:
$ java -Xint T
2
Result of Graal compiler w/ background compilations:
$ java T
2
Result of Graal compiler w/o background compilations:
$ java -XX:-BackgroundCompilation T
0
The text was updated successfully, but these errors were encountered:
@gergo- Could you explain to me why this happens only when background compilation is disabled? #4754 can be easily reproduced without disable background compilations. Thanks!
Could you explain to me why this happens only when background compilation is disabled
With background compilation disabled, an application thread that triggers a compilation will block and wait for the compilation to finish and then jump into the compiled code. That increases the likelihood of the problematic method being compiled and having the compiled code be executed. Without background compilation, the method in question maybe scheduled for compilation but complete execution in the interpreter (or as C1 compiled code) before the Graal compilation finishes.
Describe the issue
This is a JIT bug where Graal gives a different output from the interpreter or HotSpot's C1/C2 compiler only when the background compilations are disabled.
Steps to reproduce the issue
The results of aaa and bbb are different, while expected to be the same.
Describe GraalVM and your environment:
More details
The following is the source of our tests:
Result of the interpreter:
Result of Graal compiler w/ background compilations:
Result of Graal compiler w/o background compilations:
The text was updated successfully, but these errors were encountered: