Skip to content

Commit 6ea1b08

Browse files
committed
fix a bug in reg[] with immediate
1 parent e7191fb commit 6ea1b08

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

backends/asm/outasm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4918,7 +4918,7 @@ IR *EmitMove(IRList *irl, Operand *origdst, Operand *origsrc, AST *linenum)
49184918
// we can deliberately refer to memory; but mem-mem moves
49194919
// do not work out well
49204920
if (src->kind == IMM_INT || src->kind == IMM_COG_LABEL || SrcOnlyHwReg(src) || (off && src == dst) || src->kind == STRING_DEF) {
4921-
num_tmp_regs = origdst->size;
4921+
num_tmp_regs = (origdst->size + 3)/4;
49224922
if (num_tmp_regs > MAX_TMP_REGS) {
49234923
ERROR(linenum, "too many temporary registers needed");
49244924
return ir;

0 commit comments

Comments
 (0)