-
Bug
-
Resolution: Fixed
-
P3
-
hs21
-
b15
-
x86
-
solaris_10
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2212462 | 8 | Igor Veresov | P3 | Resolved | Fixed | b01 |
JDK-2210338 | 7 | Igor Veresov | P3 | Closed | Fixed | b143 |
JDK-2212463 | hs22 | Igor Veresov | P3 | Resolved | Fixed | b01 |
When running a 64-bit JVM on Windows 7, the JVM.dll failed to load due to an exception in the following code. Since long is a 32-bit integer, the casts in the operand calculation have the effect of truncating a 64-bit address to 32 bits and then sign-extending it. The casts should be to intptr_t, not long.
I encountered this in JDK 7 build 130, but the source code is the same in build 142
In hotspot\src\cpu\x86\vm\c1_LIRAssembler_x86.cpp:
// Note: 'double' and 'long long' have 32-bits alignment on x86.
static jlong* double_quadword(jlong *adr, jlong lo, jlong hi) {
// Use the expression (adr)&(~0xF) to provide 128-bits aligned address
// of 128-bits operands for SSE instructions.
jlong *operand = (jlong*)(((long)adr)&((long)(~0xF)));
// Store the value to a 128-bits operand.
operand[0] = lo;
operand[1] = hi;
return operand;
}
The corrected statement would be:
jlong *operand = (jlong*)(((intptr_t)adr)&((intptr_t)(~0xF)));
I encountered this in JDK 7 build 130, but the source code is the same in build 142
In hotspot\src\cpu\x86\vm\c1_LIRAssembler_x86.cpp:
// Note: 'double' and 'long long' have 32-bits alignment on x86.
static jlong* double_quadword(jlong *adr, jlong lo, jlong hi) {
// Use the expression (adr)&(~0xF) to provide 128-bits aligned address
// of 128-bits operands for SSE instructions.
jlong *operand = (jlong*)(((long)adr)&((long)(~0xF)));
// Store the value to a 128-bits operand.
operand[0] = lo;
operand[1] = hi;
return operand;
}
The corrected statement would be:
jlong *operand = (jlong*)(((intptr_t)adr)&((intptr_t)(~0xF)));
- backported by
-
JDK-2212462 LP64 problem with double_quadword in c1_LIRAssembler_x86.cpp
- Resolved
-
JDK-2212463 LP64 problem with double_quadword in c1_LIRAssembler_x86.cpp
- Resolved
-
JDK-2210338 LP64 problem with double_quadword in c1_LIRAssembler_x86.cpp
- Closed