Browse Source

Fix broken intarith + testop optimization.

Mike Pall 15 years ago
parent
commit
36769c2f6b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/lj_asm.c

+ 1 - 1
src/lj_asm.c

@@ -2423,9 +2423,9 @@ static void asm_comp_(ASMState *as, IRIns *ir, int cc)
 	asm_guardcc(as, cc);
 	if (usetest && left != RID_MRM) {
 	  /* Use test r,r instead of cmp r,0. */
+	  emit_rr(as, XO_TEST, left, left);
 	  if (irl+1 == ir)  /* Referencing previous ins? */
 	    as->testmcp = as->mcp;  /* Set flag to drop test r,r if possible. */
-	  emit_rr(as, XO_TEST, left, left);
 	} else {
 	  x86Op xo;
 	  if (checki8(imm)) {