Mercurial > hg > CbC > old > device
changeset 765:d2c52bcbedc8
i64 emit address fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 17 Nov 2010 19:27:13 +0900 |
parents | 742d9fcb778e |
children | 43b9c46a3c95 |
files | mc-code-i64.c mc-codegen.c |
diffstat | 2 files changed, 10 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/mc-code-i64.c Wed Nov 17 19:12:54 2010 +0900 +++ b/mc-code-i64.c Wed Nov 17 19:27:13 2010 +0900 @@ -3238,14 +3238,14 @@ data_mode(0); #ifdef __APPLE__ if (offset) - printf("\t.long _%s+%d\n",s,offset); + printf("\t.quad _%s+%d\n",s,offset); else - printf("\t.long _%s\n",s); + printf("\t.quad _%s\n",s); #else if (offset) - printf("\t.long %s+%d\n",s,offset); + printf("\t.quad %s+%d\n",s,offset); else - printf("\t.long %s\n",s); + printf("\t.quad %s\n",s); #endif }
--- a/mc-codegen.c Wed Nov 17 19:12:54 2010 +0900 +++ b/mc-codegen.c Wed Nov 17 19:27:13 2010 +0900 @@ -3640,10 +3640,6 @@ emit_short(cadr(e)); data_alignment++; return; - case LONGLONG: case ULONGLONG: - if (car(e)!=LCONST&&car(e)!=CONST) error(INERR); - emit_longlong(e); - return; case DOUBLE: if (car(e)!=DCONST&&car(e)!=FCONST) error(INERR); emit_double(e); @@ -3661,6 +3657,12 @@ return; } if (car(t)!=POINTER&&car(t)!=ARRAY) error(-1); + case LONGLONG: case ULONGLONG: + if (!(car(e)!=LCONST&&car(e)!=CONST)) { + emit_longlong(e); + return; + } + if (!lp64) error(INERR); case INT: case UNSIGNED: /* including address case */ case ENUM: switch(car(e)) {