--- old/src/cpu/x86/vm/c1_LinearScan_x86.hpp 2015-04-23 08:25:27.358343300 -0700 +++ new/src/cpu/x86/vm/c1_LinearScan_x86.hpp 2015-04-23 08:25:27.151343300 -0700 @@ -85,8 +85,9 @@ tty->print_cr("killing XMMs for trig"); } #endif + int num_caller_save_xmm_regs = FrameMap::get_num_caller_save_xmms(); int op_id = op->id(); - for (int xmm = 0; xmm < FrameMap::nof_caller_save_xmm_regs; xmm++) { + for (int xmm = 0; xmm < num_caller_save_xmm_regs; xmm++) { LIR_Opr opr = FrameMap::caller_save_xmm_reg_at(xmm); add_temp(reg_num(opr), op_id, noUse, T_ILLEGAL); } @@ -100,6 +101,10 @@ // Implementation of LinearScanWalker inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) { + int last_xmm_reg = pd_last_xmm_reg; + if (UseAVX < 3) { + last_xmm_reg = pd_first_xmm_reg + (pd_nof_xmm_regs_frame_map / 2) - 1; + } if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::byte_reg)) { assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only"); _first_reg = pd_first_byte_reg; @@ -107,7 +112,7 @@ return true; } else if ((UseSSE >= 1 && cur->type() == T_FLOAT) || (UseSSE >= 2 && cur->type() == T_DOUBLE)) { _first_reg = pd_first_xmm_reg; - _last_reg = pd_last_xmm_reg; + _last_reg = last_xmm_reg; return true; }