summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-01-14 14:49:33 -0800
committerOri Bernstein <ori@eigenstate.org>2016-01-14 14:49:33 -0800
commit199b9cbd18da9e32a3bacdee6266a098036b34be (patch)
tree6173e99157b3d5b28911871c406f1f0d6f1806b9
parent5db63a604d13a8cff98c78c4977bf1cde43ead88 (diff)
downloadmc-199b9cbd18da9e32a3bacdee6266a098036b34be.tar.gz
Don't move registers to themselves.
Missed a case.
-rw-r--r--6/gengas.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/6/gengas.c b/6/gengas.c
index ec6a43d..69ea379 100644
--- a/6/gengas.c
+++ b/6/gengas.c
@@ -151,6 +151,9 @@ void iprintf(FILE *fd, Insn *insn)
insn->args[1] = coreg(insn->args[1]->reg.colour, ModeL);
}
}
+ /* moving a reg to itself is dumb. */
+ if (insn->args[0]->reg.colour == insn->args[1]->reg.colour)
+ return;
break;
case Imovs:
if (insn->args[0]->reg.colour == Rnone || insn->args[1]->reg.colour == Rnone)