diff -r 992120803410 -r e044997c2eda src/share/vm/opto/coalesce.cpp --- a/src/share/vm/opto/coalesce.cpp Mon Oct 22 05:26:38 2018 -0400 +++ b/src/share/vm/opto/coalesce.cpp Mon Oct 15 11:00:27 2018 +0200 @@ -292,7 +292,14 @@ // Copy any flags as well _phc.clone_projs(pred, pred->end_idx(), m, copy, _phc._lrg_map); } else { - const RegMask *rm = C->matcher()->idealreg2spillmask[m->ideal_reg()]; + int ireg = m->ideal_reg(); + if (ireg == 0 || ireg == Op_RegFlags) { + assert(false, err_msg("attempted to spill a non-spillable item: %d: %s, ireg = %d", + m->_idx, m->Name(), ireg)); + C->record_method_not_compilable("attempted to spill a non-spillable item"); + return; + } + const RegMask *rm = C->matcher()->idealreg2spillmask[ireg]; copy = new (C) MachSpillCopyNode(m, *rm, *rm); // Find a good place to insert. Kinda tricky, use a subroutine insert_copy_with_overlap(pred,copy,phi_name,src_name); @@ -326,7 +333,14 @@ b->insert_node(copy, l++); l += _phc.clone_projs(b, l, m, copy, _phc._lrg_map); } else { - const RegMask *rm = C->matcher()->idealreg2spillmask[m->ideal_reg()]; + int ireg = m->ideal_reg(); + if (ireg == 0 || ireg == Op_RegFlags) { + assert(false, err_msg("attempted to spill a non-spillable item: %d: %s, ireg = %d", + m->_idx, m->Name(), ireg)); + C->record_method_not_compilable("attempted to spill a non-spillable item"); + return; + } + const RegMask *rm = C->matcher()->idealreg2spillmask[ireg]; copy = new (C) MachSpillCopyNode(m, *rm, *rm); // Insert the copy in the basic block, just before us b->insert_node(copy, l++); @@ -373,7 +387,14 @@ if( k < b->_num_succs ) continue; // Live out; do not pre-split // Split the lrg at this use - const RegMask *rm = C->matcher()->idealreg2spillmask[inp->ideal_reg()]; + int ireg = inp->ideal_reg(); + if (ireg == 0 || ireg == Op_RegFlags) { + assert(false, err_msg("attempted to spill a non-spillable item: %d: %s, ireg = %d", + inp->_idx, inp->Name(), ireg)); + C->record_method_not_compilable("attempted to spill a non-spillable item"); + return; + } + const RegMask *rm = C->matcher()->idealreg2spillmask[ireg]; Node *copy = new (C) MachSpillCopyNode( inp, *rm, *rm ); // Insert the copy in the use-def chain n->set_req(inpidx, copy );