Index: vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp (revision 521594) +++ vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp (working copy) @@ -1307,10 +1307,25 @@ // the strong constraint for the operand Constraint c; c = ((Inst*)inst)->getConstraint(it, count?0xFFFFFFFF:0x7FFFFFFF, constr.getSize()); - if (constr.isNull()) + OpndSize dstSize = inst->getOpnd(0)->getConstraint(Opnd::ConstraintKind_Calculated).getSize(); + OpndSize srcSize = opnd->getConstraint(Opnd::ConstraintKind_Calculated).getSize(); + // get index of the first auxilary use operand + Inst::Opnds uses(inst, Inst::OpndRole_Use|Inst::OpndRole_Auxilary); + Inst::Opnds::iterator useIt = uses.begin(); + if (constr.isNull()) { constr = c; - else + } else if ( inst->getKind() == Inst::Kind_CopyPseudoInst + && inst->getMnemonic() == Mnemonic_MOV + && it == useIt + && dstSize < srcSize ) + { + // target instruction is a copy from the larger operand to the smaller one. + // we should change the source operand constraint size to make MOV operation correct + // in case of operand conversion to the smaller (dst) size + constr = Constraint((OpndKind)constr.getKind(), dstSize, constr.getMask()); + } else { constr.intersectWith(c); + } count++; }