commit | 7c9ed7946c64bf3edda408dba95bdcc76c9169c8 | [log] [tgz] |
---|---|---|
author | Russ Cox <rsc@golang.org> | Wed Jun 30 20:45:50 2010 -0700 |
committer | Russ Cox <rsc@golang.org> | Wed Jun 30 20:45:50 2010 -0700 |
tree | 567422b36a4c59c8ac569a09f3caa6884c42218c | |
parent | ed39c764b886e2b19d07ccb265f6b2cf3535aa98 [diff] [blame] |
8g: out of register bug fix Fixes #868. R=ken2 CC=golang-dev https://golang.org/cl/1695049
diff --git a/src/cmd/8g/ggen.c b/src/cmd/8g/ggen.c index 110446a..8a55ffd 100644 --- a/src/cmd/8g/ggen.c +++ b/src/cmd/8g/ggen.c
@@ -672,8 +672,10 @@ a = optoas(op, nl->type); if(nr->op == OLITERAL) { + tempname(&n2, nl->type); + cgen(nl, &n2); regalloc(&n1, nl->type, res); - cgen(nl, &n1); + gmove(&n2, &n1); sc = mpgetfix(nr->val.u.xval); if(sc >= nl->type->width*8) { // large shift gets 2 shifts by width