aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-02-23 13:21:39 -0500
committerRuss Cox <rsc@golang.org>2011-02-23 13:21:39 -0500
commit63c24081a09a363735797097bf238a7c78d15fd7 (patch)
tree9cd341b6be9305132c58d7b337ea5cf2a545738d
parent9fc0f159c31e7b63708ed80982a88753db8a4a02 (diff)
downloadgo-63c24081a09a363735797097bf238a7c78d15fd7.tar.gz
go-63c24081a09a363735797097bf238a7c78d15fd7.zip
5g: fix optimizer bug
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
-rw-r--r--src/cmd/5g/gg.h1
-rw-r--r--src/cmd/5g/gsubr.c1
-rw-r--r--src/cmd/5g/reg.c4
3 files changed, 4 insertions, 2 deletions
diff --git a/src/cmd/5g/gg.h b/src/cmd/5g/gg.h
index 603c09fc8a..ce4575be95 100644
--- a/src/cmd/5g/gg.h
+++ b/src/cmd/5g/gg.h
@@ -27,6 +27,7 @@ struct Addr
uchar type;
char name;
char reg;
+ char pun;
uchar etype;
};
#define A ((Addr*)0)
diff --git a/src/cmd/5g/gsubr.c b/src/cmd/5g/gsubr.c
index 133a21b3e8..83a9949d6c 100644
--- a/src/cmd/5g/gsubr.c
+++ b/src/cmd/5g/gsubr.c
@@ -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)
diff --git a/src/cmd/5g/reg.c b/src/cmd/5g/reg.c
index f31f70535e..1cbeb3e3de 100644
--- a/src/cmd/5g/reg.c
+++ b/src/cmd/5g/reg.c
@@ -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: