Request for reviews (S): 6880034 for HS16 and HS17

Vladimir Kozlov Vladimir.Kozlov at Sun.COM
Mon Oct 5 16:26:29 PDT 2009

Fixed 6880034: SIGBUS during deoptimisation at a safepoint on 64bit-SPARC

Problem (found and described by Volker Simonis):
   Wrong numbering of the 16 upper double registers in
maps the invalid half (R_D32x, R_D34x, ..) of the double
registers F32-F62 to even VMReg numbers (96, 98, ..) and the valid
part (R_D32, R_D34, ..) to odd VMReg numbers (97, 99, ..). Later on,
when the locals array for the safepoint is constructed in
Compile::FillLocArray(), the call to OptoReg::as_VMReg(regnum) for a
valid, even double register >= F32 (e.g. 96) returns the invalid, odd
part (e.g. 97). This odd VMReg number is than stored in the Location
part of the local and leads to the the fact that reg->reg2stack()
returns odd values for float registers >= F32.
This finally leads to a BUS error due to an unaligned double read
when the location of the register is accessed through the reg_map
during deoptimisation in StackValue::create_stack_value().

Fix the double register encodings in
Use FloatRegisterImpl::number_of_registers instead of 64
in RegisterSaver::save_live_registers() and restore_live_registers().
Replace if(true) with comments in save_live_registers().

Contributed by: volker.simonis at

Reviewed by:

Fix verified (y/n): y, bug's test

Other testing:

More information about the hotspot-compiler-dev mailing list