diff options
author | Russ Cox <rsc@golang.org> | 2010-06-30 20:45:50 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-06-30 20:45:50 -0700 |
commit | dbdbfcf74725a012a6b111697f31db87bc3d392a (patch) | |
tree | 394052632498135e35ce700cc7e32e59eec990ae /src | |
parent | edea112c8d497bc4d08d40b150cbe1ca16f54ed7 (diff) | |
download | golang-dbdbfcf74725a012a6b111697f31db87bc3d392a.tar.gz |
8g: out of register bug fix
Fixes issue 868.
R=ken2
CC=golang-dev
http://codereview.appspot.com/1695049
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd/8g/ggen.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/8g/ggen.c b/src/cmd/8g/ggen.c index 110446a0d..8a55ffd59 100644 --- a/src/cmd/8g/ggen.c +++ b/src/cmd/8g/ggen.c @@ -672,8 +672,10 @@ cgen_shift(int op, Node *nl, Node *nr, Node *res) 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 |