Mercurial > hg > CbC > old > device
diff mc-codegen.c @ 128:d497c39add36 args-works
arg.c works (?)
author | kono |
---|---|
date | Thu, 03 Apr 2003 03:04:16 +0900 |
parents | eb4d8975926c |
children | 07eb1249f07a |
line wrap: on
line diff
--- a/mc-codegen.c Tue Apr 01 10:31:40 2003 +0900 +++ b/mc-codegen.c Thu Apr 03 03:04:16 2003 +0900 @@ -754,8 +754,9 @@ target,ty,e2); } else { target=list4(list2(LVAR,0), target,ty,e2); - arg_size += sz; } + /* keep arg space for register variables */ + arg_size += sz; #if DEBUG_PARALLEL_ASSIGN printf("# target %d ty %d+%d sz %d\n",car(car(target)),ty,cadr(car(target)),sz); #endif @@ -778,8 +779,8 @@ if(car(t0)==LVAR) { /* ここで、書込先アドレスを決める */ cadr(t0)=-arg_size; - arg_size-=sz; } + arg_size-=sz; if (!is_simple(car(s0))) { g_expr_u(assign_expr0((e4=list2(LVAR,new_lvar(sz))),s0,ty,ty)); use=list3(ty,use,e1); @@ -838,6 +839,13 @@ code_frame_pointer(e3); emit_pop_free(e3); } else if (is_function(fnptr)) { + if (car(e2) != FNAME) { + e2 = emit_pop(0); + code_fix_frame_pointer(disp_offset); + code_indirect_jmp(e2); + emit_pop_free(e2); + return; + } code_fix_frame_pointer(disp_offset); }