-
Bug
-
Resolution: Fixed
-
P3
-
9, 10, 11, 12
-
b21
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8226492 | 11.0.5-oracle | Roland Westrelin | P3 | Resolved | Fixed | b02 |
JDK-8218555 | 11.0.3 | Roland Westrelin | P3 | Resolved | Fixed | master |
JDK-8260826 | openjdk8u292 | Andrew Hughes | P3 | Resolved | Fixed | b01 |
JDK-8218739 | openjdk8u212 | Roland Westrelin | P3 | Resolved | Fixed | b01 |
JDK-8310012 | 8u391 | Fairoz Matte | P3 | Resolved | Fixed | b01 |
The hang itself happens in inlined function:
// Returns largest i such that 2^i <= x.
// If x < 0, the function returns 31 on a 32-bit machine and 63 on a 64-bit machine.
// If x == 0, the function returns -1.
inline int log2_intptr(intptr_t x) {
int i = -1;
uintptr_t p = 1;
while (p != 0 && p <= (uintptr_t)x) {
// p = 2^(i+1) && p <= x (i.e., 2^(i+1) <= x)
i++; p *= 2;
}
// p = 2^(i+1) && x < p (i.e., 2^i <= x < 2^(i+1))
// If p = 0, overflow has occurred and i = 31 or i = 63 (depending on the machine word size).
return i;
}
Looking at the assembly code p != 0 is optimized out.
0x00007f6494aae685 <+1157>: mov $0xffffffff,%ecx
0x00007f6494aae68a <+1162>: mov (%rax),%rdi
0x00007f6494aae68d <+1165>: mov $0x1,%eax
0x00007f6494aae692 <+1170>: nopw 0x0(%rax,%rax,1)
0x00007f6494aae698 <+1176>: add %rax,%rax
0x00007f6494aae69b <+1179>: add $0x1,%ecx
0x00007f6494aae69e <+1182>: cmp %r14,%rax
0x00007f6494aae6a1 <+1185>: jbe 0x7f6494aae698 <MulINode::Ideal(PhaseGVN*, bool)+1176>
That call is preceded by:
if( con < 0 ) {
con = -con;
}
which is undefined behavior for INT_MIN so the compiler is free to assume con != INT_MIN and then optimizing the p != 0 test is legal.
- backported by
-
JDK-8218555 C2 may hang in MulLNode::Ideal()/MulINode::Ideal() with gcc 8.2.1
- Resolved
-
JDK-8218739 C2 may hang in MulLNode::Ideal()/MulINode::Ideal() with gcc 8.2.1
- Resolved
-
JDK-8226492 C2 may hang in MulLNode::Ideal()/MulINode::Ideal() with gcc 8.2.1
- Resolved
-
JDK-8260826 C2 may hang in MulLNode::Ideal()/MulINode::Ideal() with gcc 8.2.1
- Resolved
-
JDK-8310012 C2 may hang in MulLNode::Ideal()/MulINode::Ideal() with gcc 8.2.1
- Resolved
- relates to
-
JDK-8214189 test/hotspot/jtreg/compiler/intrinsics/mathexact/MulExactLConstantTest.java fails on Windows x64 when run with -XX:-TieredCompilation
- Resolved
-
JDK-8222286 Fix for JDK-8213419 is broken on s390
- Resolved
-
JDK-8214206 Fix for JDK-8213419 is broken on 32-bit
- Closed
-
JDK-8241018 32-bit integer log2 functions return the wrong value for negative arguments on 64-bit machines
- Resolved
-
JDK-8257192 Integrate AArch64 JIT port into 8u
- Resolved