Mercurial > hg > CbC > old > device
changeset 840:1547193bddde
minor fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 04 Dec 2010 13:02:51 +0900 |
parents | aed9be3c8b78 |
children | 7da123aa5a39 |
files | mc-code-ia32.c mc-parse.c |
diffstat | 2 files changed, 14 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/mc-code-ia32.c Fri Dec 03 22:31:38 2010 +0900 +++ b/mc-code-ia32.c Sat Dec 04 13:02:51 2010 +0900 @@ -3647,12 +3647,19 @@ void code_cmp_lregister(int reg,int label,int cond) { - char *crn; - use_int(reg); - crn = register_name(reg,0); - printf("\tmovl %%esi,%s\n",crn); - printf("\torl %%edi,%s\n",crn); - printf("\ttestl %s,%s\n",crn,crn); + use_longlong(reg); + if (reg==REG_L) { + char *crn; + reg = get_register(); + crn = register_name(reg,0); + printf("\tmovl %%esi,%s\n",crn); + printf("\torl %%edi,%s\n",crn); + printf("\ttestl %s,%s\n",crn,crn); + free_register(reg); + } else { + printf("\torl %s,%s\n",l_edx(reg),l_eax(reg)); + printf("\ttestl %s,%s\n",l_eax(reg),l_eax(reg)); + } jcond(label,cond); }
--- a/mc-parse.c Fri Dec 03 22:31:38 2010 +0900 +++ b/mc-parse.c Sat Dec 04 13:02:51 2010 +0900 @@ -4276,7 +4276,7 @@ return e1; } else { if (integral(t) || t==DOUBLE || t==FLOAT || t==LONGLONG || t==ULONGLONG) - e1 = rvalue(e1); // this can be left value + e1 = rvalue(e1); // left value should not be rvalued e1 = correct_type(e1,t); type = t; return e1;