JDK-7009231 : C1: Incorrect CAS code for longs on SPARC 32bit
Type:Bug
Component:hotspot
Sub-Component:compiler
Affected Version:5.0
Priority:P2
Status:Closed
Resolution:Fixed
OS:solaris
CPU:sparc
Submitted:2010-12-28
Updated:2011-03-08
Resolved:2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
SUGGESTED FIX
Add xcc to icc conversion when generating cas on longs in 32bit. Note that we can't use brx in cmove instead because brx generates br in 32bit.
Also, propagate the type of comparison to cmove to generate proper code in 64bit.
28-12-2010
EVALUATION
On 32bit sparc we use the casx instruction and then cmp to compare new and old value. Note that in this case cmp does a 64bit compare. It is followed by cmove the generates a br instruction, which uses only icc.
Also, this behavior of cmove is incorrect in 64bit, because we always miss upper 32bits.