A down-cast always copies 8 bytes from the source operand, even if the
operand is actually smaller. This doesn't matter for register operands,
but it does for memory operands. Fix this and copy the correct number of
bytes instead.
/* Down-casts are no-ops. Upstream operations will only look at
the bytes that make up the result of the down-cast. So there
is no point setting the other bytes to 0. */
- insn = s390_opnd_copy(8, dst, opnd);
+ size = sizeofIRType(typeOfIRExpr(env->type_env, arg));
+ insn = s390_opnd_copy(size, dst, opnd);
break;
case Iop_64HIto32: