# HG changeset patch # User Shinji KONO # Date 1396767750 -32400 # Node ID 989bdd85e8af3ffad64844194a4e58c7c4baab05 # Parent 1408a5f1676f8805759159464ca2dbcbc074da77 a little better zfill diff -r 1408a5f1676f -r 989bdd85e8af mc-codegen.c --- a/mc-codegen.c Sun Apr 06 15:12:10 2014 +0900 +++ b/mc-codegen.c Sun Apr 06 16:02:30 2014 +0900 @@ -3973,20 +3973,21 @@ if (fill>63) { // call bzero } + int ass = list2(CONST,0); while(fill>0) { // should consider alignment int t = UCHAR; if (fill>=size_of_longlong) t = ULONGLONG; else if (fill>=size_of_int) t = UNSIGNED; else if (fill>=size_of_short) t = USHORT; fill -= size(t); - int ass = assign_expr0( - (offset+fill)? - lp64?list3(LADD,var,llist2(LCONST,offset+fill)): // binop? - list3(ADD,var,list2(CONST,offset+fill)): - var, - list2(CONST,0),t,t); // already correct_typed - init_vars = list2(ass,init_vars); - } + int dest = (offset+fill)?( + (car(var)==LVAR) ? ( lp64? list3n(LVAR,cadr(var)+offset+fill,ncaddr(var)) : list3n(LVAR,cadr(var)+offset+fill,ncaddr(var)) ) : + ( lp64?list3(LADD,var,llist2(LCONST,offset+fill)): list3(ADD,var,list2(CONST,offset+fill)))) : + var + ; + ass = assign_expr0(dest, ass,t,t); + } + init_vars = list2(ass,init_vars); }