]> Cypherpunks repositories - gostls13.git/commitdiff
5g: fix optimizer bug
authorRuss Cox <rsc@golang.org>
Wed, 23 Feb 2011 18:21:39 +0000 (13:21 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 23 Feb 2011 18:21:39 +0000 (13:21 -0500)
same as in issue below, never fixed on ARM

changeset:   5498:3fa1372ca694
user:        Ken Thompson <ken@golang.org>
date:        Thu May 20 17:31:28 2010 -0700

description:
fix issue 798
cannot allocate an audomatic temp
while real registers are allocated.
there is a chance that the automatic
will be allocated to one of the
allocated registers. the fix is to
not registerize such variables.

R=rsc
CC=golang-dev
https://golang.org/cl/1202042

R=ken2
CC=golang-dev
https://golang.org/cl/4226042

src/cmd/5g/gg.h
src/cmd/5g/gsubr.c
src/cmd/5g/reg.c

index 603c09fc8ac660a087b3610ff4077c482dd86ad6..ce4575be9592be345199360e05e0557a2106008f 100644 (file)
@@ -27,6 +27,7 @@ struct        Addr
        uchar   type;
        char    name;
        char    reg;
+       char pun;
        uchar   etype;
 };
 #define        A       ((Addr*)0)
index 133a21b3e8e1645717b6c5c6c150ff462dd26403..83a9949d6c87ba57e4e5eee2887a9969becb79ba 100644 (file)
@@ -1168,6 +1168,7 @@ naddr(Node *n, Addr *a, int canemitcode)
                        a->etype = simtype[n->type->etype];
                        a->width = n->type->width;
                }
+               a->pun = n->pun;
                a->offset = n->xoffset;
                a->sym = n->sym;
                if(a->sym == S)
index f31f70535ed902a53fb9ce95162ed02878372eed..1cbeb3e3deed7f58aa48c29b55518a3d4eb3164d 100644 (file)
@@ -697,8 +697,8 @@ mkvar(Reg *r, Adr *a)
        n = D_NONE;
 
        flag = 0;
-//     if(a->pun)
-//             flag = 1;
+       if(a->pun)
+               flag = 1;
 
        switch(t) {
        default: