summaryrefslogtreecommitdiff
path: root/src/cmd/gc/walk.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-03-05 15:35:09 -0800
committerRuss Cox <rsc@golang.org>2010-03-05 15:35:09 -0800
commit6fbf0007b69f26ae9eeb6e14e40dc943013e20d5 (patch)
tree67cf29cef444b0985c0a0350784166479abff782 /src/cmd/gc/walk.c
parent62be41b9e6aec434582b7bc541e0eaed1e9631da (diff)
downloadgolang-6fbf0007b69f26ae9eeb6e14e40dc943013e20d5.tar.gz
gc: better compilation of floating point +=
R=ken2 CC=golang-dev http://codereview.appspot.com/255042
Diffstat (limited to 'src/cmd/gc/walk.c')
-rw-r--r--src/cmd/gc/walk.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c
index 2f151307a..5ee82eeac 100644
--- a/src/cmd/gc/walk.c
+++ b/src/cmd/gc/walk.c
@@ -823,10 +823,13 @@ walkexpr(Node **np, NodeList **init)
}
/*
- * on 32-bit arch, rewrite 64-bit ops into l = l op r
+ * on 32-bit arch, rewrite 64-bit ops into l = l op r.
+ * on 386, rewrite float ops into l = l op r.
+ * TODO(rsc): Maybe this rewrite should be done always?
*/
et = n->left->type->etype;
- if(widthptr == 4 && (et == TUINT64 || et == TINT64)) {
+ if((widthptr == 4 && (et == TUINT64 || et == TINT64)) ||
+ (thechar == '8' && isfloat[et])) {
l = safeexpr(n->left, init);
r = nod(OAS, l, nod(n->etype, l, n->right));
typecheck(&r, Etop);