-
Bug
-
Resolution: Fixed
-
P2
-
18, 21, 22, 23, 24
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8334933 | 23.0.1 | Christian Hagedorn | P2 | Resolved | Fixed | b02 |
JDK-8334030 | 23 | Christian Hagedorn | P2 | Resolved | Fixed | b27 |
JDK-8334178 | 21.0.5-oracle | Tobias Hartmann | P2 | Closed | Fixed | b01 |
JDK-8334840 | 21.0.5 | Martin Doerr | P2 | Resolved | Fixed | b01 |
JDK-8334008 | na | Christian Hagedorn | P2 | Closed | Not an Issue |
But there is more: commenting out the lines after the loop and executing throws a "/ by zero" ArithmeticException on L.12.
In both cases, it should instead report `n=-2147483647, q=0, q1=1` and exit with code 22, as when executed in interpreter mode with -Xint.
Tried on macOS 14.5/AArch64 and Ubuntu 22.04.4/x64 with JDK 21 and 22. Executes correctly on JDK 17.
```
import static java.lang.Integer.*;
public class Buggy {
public static void main(String[] args) {
int N = -1;
int d = MIN_VALUE + 1;
long i = 0;
int n = 0;
for (; compareUnsigned(n, N) < 0; ++n, ++i) {
int q = divideUnsigned(n, d + 1);
int q1 = divideUnsigned(n, d);
if (q1 != q) {
System.out.printf("n=%d, q=%d, q1=%d%n", n, q, q1);
System.exit(22);
}
};
int q = divideUnsigned(n, d + 1);
int q1 = divideUnsigned(n, d);
if (q1 != q) {
System.out.printf("n=%d, q=%d, q1=%d", n, q, q1);
System.exit(22);
}
System.out.printf("counted=%d, expected=%d%n", i, (N & 0xFFFF_FFFFL) + 1);
}
}
```
- backported by
-
JDK-8334030 C2: Partial Peeling is wrongly applied for CmpU with negative limit
- Resolved
-
JDK-8334840 C2: Partial Peeling is wrongly applied for CmpU with negative limit
- Resolved
-
JDK-8334933 C2: Partial Peeling is wrongly applied for CmpU with negative limit
- Resolved
-
JDK-8334008 C2: Partial Peeling is wrongly applied for CmpU with negative limit
- Closed
-
JDK-8334178 C2: Partial Peeling is wrongly applied for CmpU with negative limit
- Closed
- is blocked by
-
JDK-8333366 C2: CmpU3Nodes are not pushed back to worklist in PhaseCCP leading to non-fixpoint assertion failure
- Resolved
- relates to
-
JDK-8251535 Partial peeling at unsigned test adds incorrect loop exit check
- Resolved
-
JDK-8276162 Optimise unsigned comparison pattern
- Resolved
- links to
-
Commit openjdk/jdk21u-dev/7328df4d
-
Commit openjdk/jdk/d96476d8
-
Commit openjdk/jdk/ef101f1b
-
Review openjdk/jdk21u-dev/728
-
Review openjdk/jdk/19522
-
Review openjdk/jdk/19653