Mercurial > hg > CbC > old > device
changeset 80:83d901658ce9 indirect-call
*** empty log message ***
author | kono |
---|---|
date | Mon, 03 Mar 2003 05:41:10 +0900 |
parents | 82d0e30f61dd |
children | f94ca1168520 |
files | mc-codegen.c mc-parse.c test/goto.c |
diffstat | 3 files changed, 35 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/mc-codegen.c Mon Mar 03 04:56:51 2003 +0900 +++ b/mc-codegen.c Mon Mar 03 05:41:10 2003 +0900 @@ -680,7 +680,7 @@ arg_size = 0; regs = 0; max_regs = MAX_REGISTER_VAR-1; for (e3 = reverse0(caddr(e1)); e3; e3 = cadr(e3)) { e2 = car(e3); sz = size(ty=caddr(e3)); - if (regs <= max_regs&&scalar(ty)) { + if (regs <= max_regs&&sz==size_of_int) { target=list4(list2(REGISTER,register_var(regs++)), target,ty,e2); } else { target=list4(list2(LVAR,0), target,ty,e2);
--- a/mc-parse.c Mon Mar 03 04:56:51 2003 +0900 +++ b/mc-parse.c Mon Mar 03 05:41:10 2003 +0900 @@ -772,7 +772,7 @@ } fnptr->dsp=list4(type,fnptr->dsp,(int)n,0); if (stmode==REGISTER && reg_var <MAX_REGISTER_VAR && - !(type!=CHAR && !scalar(type))) { + size(type)==size_of_int) { n->sc = REGISTER; reg_var++; cadddr(fnptr->dsp)=size_of_int;
--- a/test/goto.c Mon Mar 03 04:56:51 2003 +0900 +++ b/test/goto.c Mon Mar 03 05:41:10 2003 +0900 @@ -12,28 +12,56 @@ code a2(int i,code conv()) { - printf("%d %x\n",i,conv); + printf("a2 %d %x\n",i,conv); goto conv(i+1,a4); } code a3(int i,code (*conv)()) { - printf("%d %x\n",i,conv); + printf("a3 %d %x\n",i,conv); goto conv(i+1,a5); } code a4(int i,code conv()) { - printf("%d %x\n",i,conv); - goto (*conv)(i+1,exit0); + printf("a4 %d %x\n",i,conv); + goto (*conv)(i+1,a6); } code a5(int i,code (*conv)()) { - printf("%d %x\n",i,conv); + printf("a5 %d %x\n",i,conv); + goto (*conv)(i+1,i+2,i+3,a7); +} + +code +a6(int i,int j,int k,code conv()) +{ + printf("a6 %d %x\n",i,conv); + goto conv(i+1,j,k,a8); +} + +code +a7(int i,,int j,int k,code (*conv)()) +{ + printf("a7 %d %x\n",i,conv); + goto conv(i+1,j,k,a9); +} + +code +a8(int i,int j,int k,code conv()) +{ + printf("a8 %d %x\n",i,conv); + goto (*conv)(i+1,j,k,exit0); +} + +code +a9(int i,int j,int k,code (*conv)()) +{ + printf("a9 %d %x\n",i,conv); goto (*conv)(i+1),env; }