handle packed structure assignment Reference: /n/atom/patch/applied2013/packasgn5c Date: Tue Jun 18 20:44:20 CES 2013 Signed-off-by: quanstro@quanstro.net --- /sys/src/cmd/5c/cgen.c Tue Jun 18 20:43:52 2013 +++ /sys/src/cmd/5c/cgen.c Tue Jun 18 20:43:52 2013 @@ -848,7 +848,7 @@ Node nod0, nod1, nod2, nod3, nod4, *l, *r; Type *t; long pc1; - int i, m, c, x; + int i, m, c; if(n == Z || n->type == T) return; @@ -1060,11 +1060,7 @@ return; } - x = w & SZ_LONG-1; w /= SZ_LONG; - if(x) - warn(n, "packed assignment"); - else if(w <= 2) { if(n->complex > nn->complex) { reglpcgen(&nod1, n, 1); @@ -1167,30 +1163,6 @@ c--; i++; } while (c>0); - - if(x){ - regalloc(&nod3, ®node, Z); - nod1.xoffset += SZ_LONG*w; - nod2.xoffset += SZ_LONG*w; - nod1.type->etype = types[TUSHORT]->etype; - nod2.type->etype = types[TUSHORT]->etype; - for(; x >= SZ_SHORT; x -= SZ_SHORT){ - gmove(&nod1, &nod3); - gmove(&nod3, &nod2); - nod1.xoffset += SZ_SHORT; - nod2.xoffset += SZ_SHORT; - } - nod1.type->etype = types[TUCHAR]->etype; - nod2.type->etype = types[TUCHAR]->etype; - for(; x >= SZ_CHAR; x -= SZ_CHAR){ - gmove(&nod1, &nod3); - gmove(&nod3, &nod2); - nod1.xoffset += SZ_CHAR; - nod2.xoffset += SZ_CHAR; - } - regfree(&nod3); - } - regfree(&nod1); regfree(&nod2); }