United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-8000313 C2 should use jlong for 64bit values
JDK-8000313 : C2 should use jlong for 64bit values

Details
Type:
Bug
Submit Date:
2012-10-01
Status:
Resolved
Updated Date:
2013-04-30
Project Name:
JDK
Resolved Date:
2012-10-08
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
Fixed Versions:
hs25 (b05)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:

Sub Tasks

Description
On 9/30/12 8:45 PM, John Rose wrote:
> I just noticed this code in loopTransform:
>
>      // Use longs to avoid integer overflow.
>      int stride_con  = cl->stride_con();
>      long init_con   = cl->init_trip()->get_int();
>      long limit_con  = cl->limit()->get_int();
>      int stride_m    = stride_con - (stride_con>  0 ? 1 : -1);
>      long trip_count = (limit_con - init_con + stride_m)/stride_con;
>
> (It has your name on it.)  Don't you want jlong in such code instead of plain long?
>
> ??? John 

Yes, you are absolutely right. Maybe we should redefine 'long' so that compilers will complain about its usage. We need to find all usages of naked long (which some C++ compilers treats as 32-bit value) and replace it with jlong (which is defined in Hotspot as always 64-bit value).

Vladimir

                                    

Comments
URL:   http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/377508648226
User:  kvn
Date:  2012-10-08 21:52:06 +0000

                                     
2012-10-08
URL:   http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/377508648226
User:  amurillo
Date:  2012-10-12 23:14:51 +0000

                                     
2012-10-12



Hardware and Software, Engineered to Work Together