Mercurial > hg > CbC > old > device
diff mc-code-ia32.c @ 159:b80e9737c3ce
regs[creg]==0 in ia32
author | kono |
---|---|
date | Thu, 14 Aug 2003 02:40:39 +0900 |
parents | da529eab5618 |
children | fc8514c9d685 |
line wrap: on
line diff
--- a/mc-code-ia32.c Thu Aug 14 01:37:19 2003 +0900 +++ b/mc-code-ia32.c Thu Aug 14 02:40:39 2003 +0900 @@ -402,7 +402,7 @@ void emit_pop_free(int xreg) { - if (xreg==dreg) { + if (xreg==dreg||xreg==creg) { regv[dreg]=0; } else if (xreg>=0) { free_register(xreg); @@ -484,6 +484,7 @@ { int new_reg; new_reg = get_register(); + if (new_reg==creg) error(-1); if(new_reg<0) { /* もうレジスタがない */ if (reg_sp>=MAX_MAX) error(-1); reg_stack[reg_sp++] = -1; @@ -1146,7 +1147,7 @@ tosop(op,xreg); creg = xreg; printf("\tmovl %s,%s\n",register_name(reg,0),register_name(creg,0)); - regv[creg]=1; + regs[creg]=regv[creg]=1; } @@ -1250,7 +1251,7 @@ edx_cleanup(); break; } - if (oreg!=dreg&&oreg>=0) + if (oreg!=dreg&&oreg!=creg&&oreg>=0) free_register(oreg); else if (oreg==dreg) regv[dreg]=0; regv[creg]=1;