United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6787106 Hotspot 32 bit build fails on platforms having different definitions for intptr_t & int32_t
JDK-6787106 : Hotspot 32 bit build fails on platforms having different definitions for intptr_t & int32_t

Details
Type:
Bug
Submit Date:
2008-12-18
Status:
Closed
Updated Date:
2012-10-08
Project Name:
JDK
Resolved Date:
2009-02-11
Component:
hotspot
OS:
os_x
Sub-Component:
runtime
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs15 (b01)

Related Reports
Backport:
Backport:
Relates:

Sub Tasks

Description
On 32 bit Mac OS, intptr_t is typedefed as long and int32_t is typedefed as int. This is not true on other platforms such as Solaris & most of Linux distributions including BSD. In some hotspot code, we rely on the  assumption that intptr_t & int32_t are same so cast from one to another automatically works. This will certainly fail on platforms which does not have that assumption. 

Here is an example. In assembler_x86.hpp, we have the following definitions in class MacroAssembler:

void movptr(Address dst, intptr_t src);
void movptr(Address dst, Reigster src); (Register is defined as RegisterImpl*)

In the places we want to clear the destination address, we simply call movptr(dest, (int32_t)NULL); the cast is necessary to make the compiler to resolve the ambiguity which we believe it will pick up the intptr_t version. This will break on platforms such as Mac OS X since the cast still hasn't made it clear which one to choose.

                                    

Comments
EVALUATION

A short term fix might be just fix the cast.
                                     
2008-12-18
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/db4caa99ef11
                                     
2008-12-24



Hardware and Software, Engineered to Work Together