]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/5g: avoid clash between R13 and F3 registers.
authorRémy Oudompheng <oudomphe@phare.normalesup.org>
Tue, 27 Aug 2013 19:09:16 +0000 (21:09 +0200)
committerRémy Oudompheng <oudomphe@phare.normalesup.org>
Tue, 27 Aug 2013 19:09:16 +0000 (21:09 +0200)
Fixes #6247.

R=golang-dev, lucio.dere, bradfitz
CC=golang-dev
https://golang.org/cl/13216043

src/cmd/5g/gg.h
test/fixedbugs/issue6247.go [new file with mode: 0644]

index c0d0393ae2c889417a9b09e801039c1b83e24a9e..860817f69ec2e3f556733bf4758b1b04e04650f0 100644 (file)
@@ -51,7 +51,7 @@ struct        Prog
 
 #define REGALLOC_R0 0
 #define REGALLOC_RMAX REGEXT
-#define REGALLOC_F0 (REGALLOC_RMAX+1)
+#define REGALLOC_F0 NREG
 #define REGALLOC_FMAX (REGALLOC_F0 + FREGEXT)
 
 EXTERN int32   dynloc;
diff --git a/test/fixedbugs/issue6247.go b/test/fixedbugs/issue6247.go
new file mode 100644 (file)
index 0000000..eea8f9c
--- /dev/null
@@ -0,0 +1,17 @@
+// compile
+
+// Copyright 2013 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 6247: 5g used to be confused by the numbering
+// of floating-point registers.
+
+package main
+
+var p map[string]interface{}
+var v interface{}
+
+func F() {
+       p["hello"] = v.(complex128) * v.(complex128)
+}