]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/{5,6,8}g: reduce size of Prog and Addr
authorDave Cheney <dave@cheney.net>
Thu, 13 Dec 2012 19:20:24 +0000 (06:20 +1100)
committerDave Cheney <dave@cheney.net>
Thu, 13 Dec 2012 19:20:24 +0000 (06:20 +1100)
5g: Prog went from 128 bytes to 88 bytes
6g: Prog went from 174 bytes to 144 bytes
8g: Prog went from 124 bytes to 92 bytes

There may be a little more that can be squeezed out of Addr, but alignment will be a factor.

All: remove the unused pun field from Addr

R=rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6922048

17 files changed:
src/cmd/5g/gg.h
src/cmd/5g/gobj.c
src/cmd/5g/gsubr.c
src/cmd/5g/list.c
src/cmd/5g/reg.c
src/cmd/6g/gg.h
src/cmd/6g/gobj.c
src/cmd/6g/gsubr.c
src/cmd/6g/list.c
src/cmd/6g/peep.c
src/cmd/6g/reg.c
src/cmd/8g/gg.h
src/cmd/8g/gobj.c
src/cmd/8g/gsubr.c
src/cmd/8g/list.c
src/cmd/8g/peep.c
src/cmd/8g/reg.c

index 394ca4730bbbb9a755b5ac556e1cb0f957381e10..fe427227c61f836ea0d5a68e7b177286f7b4e2fc 100644 (file)
@@ -15,9 +15,13 @@ struct       Addr
 {
        int32   offset;
        int32   offset2;
-       double  dval;
-       Prog*   branch;
-       char    sval[NSNAME];
+
+       union {
+               double  dval;
+               vlong   vval;
+               Prog*   branch;
+               char    sval[NSNAME];
+       } u;
 
        Sym*    sym;
        Node*   node;
@@ -25,22 +29,21 @@ struct      Addr
        uchar   type;
        char    name;
        uchar   reg;
-       char pun;
        uchar   etype;
 };
 #define        A       ((Addr*)0)
 
 struct Prog
 {
-       short   as;             // opcode
        uint32  loc;            // pc offset in this func
        uint32  lineno;         // source line that generated this
-       Addr    from;           // src address
-       Addr    to;             // dst address
        Prog*   link;           // next instruction in this func
        void*   regp;           // points to enclosing Reg struct
+       short   as;             // opcode
        uchar   reg;            // doubles as width in DATA op
        uchar   scond;
+       Addr    from;           // src address
+       Addr    to;             // dst address
 };
 
 #define TEXTFLAG reg
index 4c9d0b7a1cfcf5c485512f53182797caee2ead8b..78eadfadb5db0960cf7eb0d5bff3ae633decb639 100644 (file)
@@ -128,9 +128,9 @@ zaddr(Biobuf *b, Addr *a, int s)
                break;
 
        case D_BRANCH:
-               if(a->branch == nil)
+               if(a->u.branch == nil)
                        fatal("unpatched branch");
-               a->offset = a->branch->loc;
+               a->offset = a->u.branch->loc;
                l = a->offset;
                Bputc(b, l);
                Bputc(b, l>>8);
@@ -139,7 +139,7 @@ zaddr(Biobuf *b, Addr *a, int s)
                break;
 
        case D_SCONST:
-               n = a->sval;
+               n = a->u.sval;
                for(i=0; i<NSNAME; i++) {
                        Bputc(b, *n);
                        n++;
@@ -152,7 +152,7 @@ zaddr(Biobuf *b, Addr *a, int s)
                break;
 
        case D_FCONST:
-               ieeedtod(&e, a->dval);
+               ieeedtod(&e, a->u.dval);
                l = e;
                Bputc(b, l);
                Bputc(b, l>>8);
@@ -289,7 +289,7 @@ dsname(Sym *sym, int off, char *t, int n)
        p->to.name = D_NONE;
        p->to.reg = NREG;
        p->to.offset = 0;
-       memmove(p->to.sval, t, n);
+       memmove(p->to.u.sval, t, n);
        return off + n;
 }
 
@@ -373,13 +373,13 @@ gdatacomplex(Node *nam, Mpcplx *cval)
        p = gins(ADATA, nam, N);
        p->reg = w;
        p->to.type = D_FCONST;
-       p->to.dval = mpgetflt(&cval->real);
+       p->to.u.dval = mpgetflt(&cval->real);
 
        p = gins(ADATA, nam, N);
        p->reg = w;
        p->from.offset += w;
        p->to.type = D_FCONST;
-       p->to.dval = mpgetflt(&cval->imag);
+       p->to.u.dval = mpgetflt(&cval->imag);
 }
 
 void
index 0885601225116227f04d96b7bd751a2f0ebc3782..f023b269c81084a3abe2c1eeb76e4fd91d97c648 100644 (file)
@@ -123,7 +123,7 @@ gbranch(int as, Type *t, int likely)
 
        p = prog(as);
        p->to.type = D_BRANCH;
-       p->to.branch = P;
+       p->to.u.branch = P;
        return p;
 }
 
@@ -135,7 +135,7 @@ patch(Prog *p, Prog *to)
 {
        if(p->to.type != D_BRANCH)
                fatal("patch: not a branch");
-       p->to.branch = to;
+       p->to.u.branch = to;
        p->to.offset = to->loc;
 }
 
@@ -146,8 +146,8 @@ unpatch(Prog *p)
 
        if(p->to.type != D_BRANCH)
                fatal("unpatch: not a branch");
-       q = p->to.branch;
-       p->to.branch = P;
+       q = p->to.u.branch;
+       p->to.u.branch = P;
        p->to.offset = 0;
        return q;
 }
@@ -1326,7 +1326,7 @@ naddr(Node *n, Addr *a, int canemitcode)
                        break;
                case CTFLT:
                        a->type = D_FCONST;
-                       a->dval = mpgetflt(n->val.u.fval);
+                       a->u.dval = mpgetflt(n->val.u.fval);
                        break;
                case CTINT:
                case CTRUNE:
index 25969369566f4ee5d17be3d28454853dd59c6f44..9f67f79f432fbbf54256c0b1ee42295f9482e99a 100644 (file)
@@ -166,24 +166,24 @@ Dconv(Fmt *fp)
                break;
 
        case D_BRANCH:
-               if(a->branch == P || a->branch->loc == 0) {
+               if(a->u.branch == P || a->u.branch->loc == 0) {
                        if(a->sym != S)
                                sprint(str, "%s+%d(APC)", a->sym->name, a->offset);
                        else
                                sprint(str, "%d(APC)", a->offset);
                } else
                        if(a->sym != S)
-                               sprint(str, "%s+%d(APC)", a->sym->name, a->branch->loc);
+                               sprint(str, "%s+%d(APC)", a->sym->name, a->u.branch->loc);
                        else
-                               sprint(str, "%d(APC)", a->branch->loc);
+                               sprint(str, "%d(APC)", a->u.branch->loc);
                break;
 
        case D_FCONST:
-               snprint(str, sizeof(str), "$(%.17e)", a->dval);
+               snprint(str, sizeof(str), "$(%.17e)", a->u.dval);
                break;
 
        case D_SCONST:
-               snprint(str, sizeof(str), "$\"%Y\"", a->sval);
+               snprint(str, sizeof(str), "$\"%Y\"", a->u.sval);
                break;
 
                // TODO(kaib): Add back
index 100cff2dee199a39743f79997672bdb79374b6ee..14cda5148812005da44c6cbbab0ddcff728bb9a4 100644 (file)
@@ -437,9 +437,9 @@ regopt(Prog *firstp)
        for(r=firstr; r!=R; r=r->link) {
                p = r->prog;
                if(p->to.type == D_BRANCH) {
-                       if(p->to.branch == P)
+                       if(p->to.u.branch == P)
                                fatal("pnil %P", p);
-                       r1 = p->to.branch->regp;
+                       r1 = p->to.u.branch->regp;
                        if(r1 == R)
                                fatal("rnil %P", p);
                        if(r1 == r) {
@@ -704,8 +704,8 @@ brk:
                while(p->link != P && p->link->as == ANOP)
                        p->link = p->link->link;
                if(p->to.type == D_BRANCH)
-                       while(p->to.branch != P && p->to.branch->as == ANOP)
-                               p->to.branch = p->to.branch->link;
+                       while(p->to.u.branch != P && p->to.u.branch->as == ANOP)
+                               p->to.u.branch = p->to.u.branch->link;
                if(p->as == AMOVW && p->to.reg == 13) {
                        if(p->scond & C_WBIT) {
                                vreg = -p->to.offset;           // in adjust region
@@ -1687,7 +1687,7 @@ chasejmp(Prog *p, int *jmploop)
                        *jmploop = 1;
                        break;
                }
-               p = p->to.branch;
+               p = p->to.u.branch;
        }
        return p;
 }
@@ -1709,8 +1709,8 @@ mark(Prog *firstp)
                if(p->regp != dead)
                        break;
                p->regp = alive;
-               if(p->as != ABL && p->to.type == D_BRANCH && p->to.branch)
-                       mark(p->to.branch);
+               if(p->as != ABL && p->to.type == D_BRANCH && p->to.u.branch)
+                       mark(p->to.u.branch);
                if(p->as == AB || p->as == ARET || (p->as == ABL && noreturn(p)))
                        break;
        }
@@ -1730,8 +1730,8 @@ fixjmp(Prog *firstp)
        for(p=firstp; p; p=p->link) {
                if(debug['R'] && debug['v'])
                        print("%P\n", p);
-               if(p->as != ABL && p->to.type == D_BRANCH && p->to.branch && p->to.branch->as == AB) {
-                       p->to.branch = chasejmp(p->to.branch, &jmploop);
+               if(p->as != ABL && p->to.type == D_BRANCH && p->to.u.branch && p->to.u.branch->as == AB) {
+                       p->to.u.branch = chasejmp(p->to.u.branch, &jmploop);
                        if(debug['R'] && debug['v'])
                                print("->%P\n", p);
                }
@@ -1767,7 +1767,7 @@ fixjmp(Prog *firstp)
        if(!jmploop) {
                last = nil;
                for(p=firstp; p; p=p->link) {
-                       if(p->as == AB && p->to.type == D_BRANCH && p->to.branch == p->link) {
+                       if(p->as == AB && p->to.type == D_BRANCH && p->to.u.branch == p->link) {
                                if(debug['R'] && debug['v'])
                                        print("del %P\n", p);
                                continue;
index 2806fbc932ef416c92e036c468d70603439e6fc9..df99c1a6544a46bc8822f8245b1f9c7c39a867e7 100644 (file)
@@ -14,9 +14,13 @@ typedef      struct  Addr    Addr;
 struct Addr
 {
        vlong   offset;
-       double  dval;
-       Prog*   branch;
-       char    sval[NSNAME];
+       
+       union {
+               double  dval;
+               vlong   vval;
+               Prog*   branch;
+               char    sval[NSNAME];
+       } u;
 
        Sym*    gotype;
        Sym*    sym;
@@ -26,7 +30,6 @@ struct        Addr
        uchar   index;
        uchar   etype;
        uchar   scale;  /* doubles as width in DATA op */
-       uchar   pun;    /* dont register variable */
 };
 #define        A       ((Addr*)0)
 
index 07ee32d6a211405d5a66b7030f7df1f33e2e3c23..508a3548ff5d608dfa7ee9b29c5a9b233d2dee7a 100644 (file)
@@ -94,9 +94,9 @@ zaddr(Biobuf *b, Addr *a, int s, int gotype)
        switch(a->type) {
 
        case D_BRANCH:
-               if(a->branch == nil)
+               if(a->u.branch == nil)
                        fatal("unpatched branch");
-               a->offset = a->branch->loc;
+               a->offset = a->u.branch->loc;
 
        default:
                t |= T_TYPE;
@@ -139,7 +139,7 @@ zaddr(Biobuf *b, Addr *a, int s, int gotype)
        if(t & T_SYM)           /* implies sym */
                Bputc(b, s);
        if(t & T_FCONST) {
-               ieeedtod(&e, a->dval);
+               ieeedtod(&e, a->u.dval);
                l = e;
                Bputc(b, l);
                Bputc(b, l>>8);
@@ -153,7 +153,7 @@ zaddr(Biobuf *b, Addr *a, int s, int gotype)
                return;
        }
        if(t & T_SCONST) {
-               n = a->sval;
+               n = a->u.sval;
                for(i=0; i<NSNAME; i++) {
                        Bputc(b, *n);
                        n++;
@@ -295,7 +295,7 @@ dsname(Sym *s, int off, char *t, int n)
        
        p->to.type = D_SCONST;
        p->to.index = D_NONE;
-       memmove(p->to.sval, t, n);
+       memmove(p->to.u.sval, t, n);
        return off + n;
 }
 
@@ -364,13 +364,13 @@ gdatacomplex(Node *nam, Mpcplx *cval)
        p = gins(ADATA, nam, N);
        p->from.scale = w;
        p->to.type = D_FCONST;
-       p->to.dval = mpgetflt(&cval->real);
+       p->to.u.dval = mpgetflt(&cval->real);
 
        p = gins(ADATA, nam, N);
        p->from.scale = w;
        p->from.offset += w;
        p->to.type = D_FCONST;
-       p->to.dval = mpgetflt(&cval->imag);
+       p->to.u.dval = mpgetflt(&cval->imag);
 }
 
 void
index 35f3c9d31f9baea70fe4072ed95f26259c486d5e..65d5ad786fa5413130f664d80ce91df1f50c54dd 100644 (file)
@@ -117,7 +117,7 @@ gbranch(int as, Type *t, int likely)
 
        p = prog(as);
        p->to.type = D_BRANCH;
-       p->to.branch = P;
+       p->to.u.branch = P;
        if(as != AJMP && likely != 0) {
                p->from.type = D_CONST;
                p->from.offset = likely > 0;
@@ -133,7 +133,7 @@ patch(Prog *p, Prog *to)
 {
        if(p->to.type != D_BRANCH)
                fatal("patch: not a branch");
-       p->to.branch = to;
+       p->to.u.branch = to;
        p->to.offset = to->loc;
 }
 
@@ -144,8 +144,8 @@ unpatch(Prog *p)
 
        if(p->to.type != D_BRANCH)
                fatal("unpatch: not a branch");
-       q = p->to.branch;
-       p->to.branch = P;
+       q = p->to.u.branch;
+       p->to.u.branch = P;
        p->to.offset = 0;
        return q;
 }
@@ -1202,7 +1202,7 @@ naddr(Node *n, Addr *a, int canemitcode)
                        break;
                case CTFLT:
                        a->type = D_FCONST;
-                       a->dval = mpgetflt(n->val.u.fval);
+                       a->u.dval = mpgetflt(n->val.u.fval);
                        break;
                case CTINT:
                case CTRUNE:
index ad63f7d29ef0ffe1764452ddfa84b0f5600e4e91..d84cceffb848d01dad1aa1c20d132228af29b2eb 100644 (file)
@@ -107,10 +107,10 @@ Dconv(Fmt *fp)
                break;
 
        case D_BRANCH:
-               if(a->branch == nil)
+               if(a->u.branch == nil)
                        snprint(str, sizeof(str), "<nil>");
                else
-                       snprint(str, sizeof(str), "%d", a->branch->loc);
+                       snprint(str, sizeof(str), "%d", a->u.branch->loc);
                break;
 
        case D_EXTERN:
@@ -140,11 +140,11 @@ Dconv(Fmt *fp)
                break;
 
        case D_FCONST:
-               snprint(str, sizeof(str), "$(%.17e)", a->dval);
+               snprint(str, sizeof(str), "$(%.17e)", a->u.dval);
                break;
 
        case D_SCONST:
-               snprint(str, sizeof(str), "$\"%Y\"", a->sval);
+               snprint(str, sizeof(str), "$\"%Y\"", a->u.sval);
                break;
 
        case D_ADDR:
index ec0a744b4257a954c98191594c676881cea12b29..231ce5314a0ebe94d46e7d78310337ddaf3117a9 100644 (file)
@@ -1303,7 +1303,7 @@ loop:
                if(p->from.node == p0->from.node)
                if(p->from.offset == p0->from.offset)
                if(p->from.scale == p0->from.scale)
-               if(p->from.dval == p0->from.dval)
+               if(p->from.u.vval == p0->from.u.vval)
                if(p->from.index == p0->from.index) {
                        excise(r);
                        goto loop;
index c92630f07c84506264e7656011f85f0e4ff97c18..8d15bf979033e038d070e1a12589d77917764e98 100644 (file)
@@ -610,9 +610,9 @@ regopt(Prog *firstp)
        for(r=firstr; r!=R; r=r->link) {
                p = r->prog;
                if(p->to.type == D_BRANCH) {
-                       if(p->to.branch == P)
+                       if(p->to.u.branch == P)
                                fatal("pnil %P", p);
-                       r1 = p->to.branch->reg;
+                       r1 = p->to.u.branch->reg;
                        if(r1 == R)
                                fatal("rnil %P", p);
                        if(r1 == r) {
@@ -804,8 +804,8 @@ brk:
                while(p->link != P && p->link->as == ANOP)
                        p->link = p->link->link;
                if(p->to.type == D_BRANCH)
-                       while(p->to.branch != P && p->to.branch->as == ANOP)
-                               p->to.branch = p->to.branch->link;
+                       while(p->to.u.branch != P && p->to.u.branch->as == ANOP)
+                               p->to.u.branch = p->to.u.branch->link;
        }
 
        if(lastr != R) {
@@ -1751,7 +1751,7 @@ chasejmp(Prog *p, int *jmploop)
                        *jmploop = 1;
                        break;
                }
-               p = p->to.branch;
+               p = p->to.u.branch;
        }
        return p;
 }
@@ -1773,8 +1773,8 @@ mark(Prog *firstp)
                if(p->reg != dead)
                        break;
                p->reg = alive;
-               if(p->as != ACALL && p->to.type == D_BRANCH && p->to.branch)
-                       mark(p->to.branch);
+               if(p->as != ACALL && p->to.type == D_BRANCH && p->to.u.branch)
+                       mark(p->to.u.branch);
                if(p->as == AJMP || p->as == ARET || p->as == AUNDEF)
                        break;
        }
@@ -1794,8 +1794,8 @@ fixjmp(Prog *firstp)
        for(p=firstp; p; p=p->link) {
                if(debug['R'] && debug['v'])
                        print("%P\n", p);
-               if(p->as != ACALL && p->to.type == D_BRANCH && p->to.branch && p->to.branch->as == AJMP) {
-                       p->to.branch = chasejmp(p->to.branch, &jmploop);
+               if(p->as != ACALL && p->to.type == D_BRANCH && p->to.u.branch && p->to.u.branch->as == AJMP) {
+                       p->to.u.branch = chasejmp(p->to.u.branch, &jmploop);
                        if(debug['R'] && debug['v'])
                                print("->%P\n", p);
                }
@@ -1831,7 +1831,7 @@ fixjmp(Prog *firstp)
        if(!jmploop) {
                last = nil;
                for(p=firstp; p; p=p->link) {
-                       if(p->as == AJMP && p->to.type == D_BRANCH && p->to.branch == p->link) {
+                       if(p->as == AJMP && p->to.type == D_BRANCH && p->to.u.branch == p->link) {
                                if(debug['R'] && debug['v'])
                                        print("del %P\n", p);
                                continue;
index 3d53601523706f5fbe330b009645761ea10ae058..fed3093cc6fd592c366576c4e7a85e67557ea290 100644 (file)
@@ -16,9 +16,12 @@ struct       Addr
        int32   offset;
        int32   offset2;
 
-       double  dval;
-       Prog*   branch;
-       char    sval[NSNAME];
+       union {
+               double  dval;
+               vlong   vval;
+               Prog*   branch;
+               char    sval[NSNAME];
+       } u;
 
        Sym*    gotype;
        Sym*    sym;
@@ -28,7 +31,6 @@ struct        Addr
        uchar   index;
        uchar   etype;
        uchar   scale;  /* doubles as width in DATA op */
-       uchar   pun;    /* dont register variable */
 };
 #define        A       ((Addr*)0)
 
index da0055cd9b9792db9b148982472e31361852b0a2..39717d5b1ace82ea47b372be4bac025a03919e42 100644 (file)
@@ -94,9 +94,9 @@ zaddr(Biobuf *b, Addr *a, int s, int gotype)
        switch(a->type) {
 
        case D_BRANCH:
-               if(a->branch == nil)
+               if(a->u.branch == nil)
                        fatal("unpatched branch");
-               a->offset = a->branch->loc;
+               a->offset = a->u.branch->loc;
 
        default:
                t |= T_TYPE;
@@ -137,7 +137,7 @@ zaddr(Biobuf *b, Addr *a, int s, int gotype)
        if(t & T_SYM)           /* implies sym */
                Bputc(b, s);
        if(t & T_FCONST) {
-               ieeedtod(&e, a->dval);
+               ieeedtod(&e, a->u.dval);
                l = e;
                Bputc(b, l);
                Bputc(b, l>>8);
@@ -151,7 +151,7 @@ zaddr(Biobuf *b, Addr *a, int s, int gotype)
                return;
        }
        if(t & T_SCONST) {
-               n = a->sval;
+               n = a->u.sval;
                for(i=0; i<NSNAME; i++) {
                        Bputc(b, *n);
                        n++;
@@ -293,7 +293,7 @@ dsname(Sym *s, int off, char *t, int n)
        
        p->to.type = D_SCONST;
        p->to.index = D_NONE;
-       memmove(p->to.sval, t, n);
+       memmove(p->to.u.sval, t, n);
        return off + n;
 }
 
@@ -373,13 +373,13 @@ gdatacomplex(Node *nam, Mpcplx *cval)
        p = gins(ADATA, nam, N);
        p->from.scale = w;
        p->to.type = D_FCONST;
-       p->to.dval = mpgetflt(&cval->real);
+       p->to.u.dval = mpgetflt(&cval->real);
 
        p = gins(ADATA, nam, N);
        p->from.scale = w;
        p->from.offset += w;
        p->to.type = D_FCONST;
-       p->to.dval = mpgetflt(&cval->imag);
+       p->to.u.dval = mpgetflt(&cval->imag);
 }
 
 void
index 64aa1db93ef3c7d07b00be98e348ef3d6924957b..dbea45a20191e621233d6650f6e8b95882e27d93 100644 (file)
@@ -118,7 +118,7 @@ gbranch(int as, Type *t, int likely)
        USED(t);
        p = prog(as);
        p->to.type = D_BRANCH;
-       p->to.branch = P;
+       p->to.u.branch = P;
        if(likely != 0) {
                p->from.type = D_CONST;
                p->from.offset = likely > 0;
@@ -134,7 +134,7 @@ patch(Prog *p, Prog *to)
 {
        if(p->to.type != D_BRANCH)
                fatal("patch: not a branch");
-       p->to.branch = to;
+       p->to.u.branch = to;
        p->to.offset = to->loc;
 }
 
@@ -145,8 +145,8 @@ unpatch(Prog *p)
 
        if(p->to.type != D_BRANCH)
                fatal("unpatch: not a branch");
-       q = p->to.branch;
-       p->to.branch = P;
+       q = p->to.u.branch;
+       p->to.u.branch = P;
        p->to.offset = 0;
        return q;
 }
@@ -1932,7 +1932,7 @@ naddr(Node *n, Addr *a, int canemitcode)
                        break;
                case CTFLT:
                        a->type = D_FCONST;
-                       a->dval = mpgetflt(n->val.u.fval);
+                       a->u.dval = mpgetflt(n->val.u.fval);
                        break;
                case CTINT:
                case CTRUNE:
index 88d3d5f7e34c52d029361a58f1cd4c5449633891..6e511978d30d9f5f2f543b0607ec0b45eeaa2c11 100644 (file)
@@ -107,7 +107,7 @@ Dconv(Fmt *fp)
                break;
 
        case D_BRANCH:
-               snprint(str, sizeof(str), "%d", a->branch->loc);
+               snprint(str, sizeof(str), "%d", a->u.branch->loc);
                break;
 
        case D_EXTERN:
@@ -137,11 +137,11 @@ Dconv(Fmt *fp)
                break;
 
        case D_FCONST:
-               snprint(str, sizeof(str), "$(%.17e)", a->dval);
+               snprint(str, sizeof(str), "$(%.17e)", a->u.dval);
                break;
 
        case D_SCONST:
-               snprint(str, sizeof(str), "$\"%Y\"", a->sval);
+               snprint(str, sizeof(str), "$\"%Y\"", a->u.sval);
                break;
 
        case D_ADDR:
index 91e7bdecdd800c540a2095a589bca6bbb9a5f6a1..31e871eeb8550ad2a80287b4be6df2b9bc638d48 100644 (file)
@@ -961,7 +961,7 @@ loop:
                if(p->from.node == p0->from.node)
                if(p->from.offset == p0->from.offset)
                if(p->from.scale == p0->from.scale)
-               if(p->from.dval == p0->from.dval)
+               if(p->from.u.vval == p0->from.u.vval)
                if(p->from.index == p0->from.index) {
                        excise(r);
                        goto loop;
index aa2f6fde180abe8f49eb3498dfb4e74677d23d40..2c7553620c84a468f20c681017252baa7309d7e0 100644 (file)
@@ -507,9 +507,9 @@ regopt(Prog *firstp)
        for(r=firstr; r!=R; r=r->link) {
                p = r->prog;
                if(p->to.type == D_BRANCH) {
-                       if(p->to.branch == P)
+                       if(p->to.u.branch == P)
                                fatal("pnil %P", p);
-                       r1 = p->to.branch->reg;
+                       r1 = p->to.u.branch->reg;
                        if(r1 == R)
                                fatal("rnil %P", p);
                        if(r1 == r) {
@@ -690,8 +690,8 @@ brk:
                while(p->link != P && p->link->as == ANOP)
                        p->link = p->link->link;
                if(p->to.type == D_BRANCH)
-                       while(p->to.branch != P && p->to.branch->as == ANOP)
-                               p->to.branch = p->to.branch->link;
+                       while(p->to.u.branch != P && p->to.u.branch->as == ANOP)
+                               p->to.u.branch = p->to.u.branch->link;
        }
 
        if(lastr != R) {
@@ -1600,7 +1600,7 @@ chasejmp(Prog *p, int *jmploop)
                        *jmploop = 1;
                        break;
                }
-               p = p->to.branch;
+               p = p->to.u.branch;
        }
        return p;
 }
@@ -1622,8 +1622,8 @@ mark(Prog *firstp)
                if(p->reg != dead)
                        break;
                p->reg = alive;
-               if(p->as != ACALL && p->to.type == D_BRANCH && p->to.branch)
-                       mark(p->to.branch);
+               if(p->as != ACALL && p->to.type == D_BRANCH && p->to.u.branch)
+                       mark(p->to.u.branch);
                if(p->as == AJMP || p->as == ARET || p->as == AUNDEF)
                        break;
        }
@@ -1643,8 +1643,8 @@ fixjmp(Prog *firstp)
        for(p=firstp; p; p=p->link) {
                if(debug['R'] && debug['v'])
                        print("%P\n", p);
-               if(p->as != ACALL && p->to.type == D_BRANCH && p->to.branch && p->to.branch->as == AJMP) {
-                       p->to.branch = chasejmp(p->to.branch, &jmploop);
+               if(p->as != ACALL && p->to.type == D_BRANCH && p->to.u.branch && p->to.u.branch->as == AJMP) {
+                       p->to.u.branch = chasejmp(p->to.u.branch, &jmploop);
                        if(debug['R'] && debug['v'])
                                print("->%P\n", p);
                }
@@ -1680,7 +1680,7 @@ fixjmp(Prog *firstp)
        if(!jmploop) {
                last = nil;
                for(p=firstp; p; p=p->link) {
-                       if(p->as == AJMP && p->to.type == D_BRANCH && p->to.branch == p->link) {
+                       if(p->as == AJMP && p->to.type == D_BRANCH && p->to.u.branch == p->link) {
                                if(debug['R'] && debug['v'])
                                        print("del %P\n", p);
                                continue;