]> Cypherpunks repositories - gostls13.git/commitdiff
stop the 5c optimizer from clobbering extern static registers.
authorKai Backman <kaib@golang.org>
Thu, 11 Feb 2010 06:42:05 +0000 (22:42 -0800)
committerKai Backman <kaib@golang.org>
Thu, 11 Feb 2010 06:42:05 +0000 (22:42 -0800)
R=rsc, ken2
CC=golang-dev
https://golang.org/cl/204064

src/cmd/5c/reg.c

index a1508b91aae45ee7857106b5533c7b733fbf22f3..f2d38d51963edc68f6a86eb0e5596cfa7aaff7a1 100644 (file)
@@ -79,6 +79,10 @@ regopt(Prog *p)
                Reg*    p;
        } log5[6], *lp;
 
+       // TODO(kaib): optimizer disabled because it smashes R8 when running out of registers
+       // the disable is unconventionally here because the call is in common code shared by 5c/6c/8c
+       return;
+
        firstr = R;
        lastr = R;
        nvar = 0;
@@ -1147,7 +1151,7 @@ int32
 RtoB(int r)
 {
 
-       if(r < 2 || r >= REGTMP)
+       if(r < 2 || r >= REGTMP-2)      // excluded R9 and R10 for m and g
                return 0;
        return 1L << r;
 }
@@ -1155,7 +1159,7 @@ RtoB(int r)
 int
 BtoR(int32 b)
 {
-       b &= 0x07fcL;
+       b &= 0x01fcL;   // excluded R9 and R10 for m and g
        if(b == 0)
                return 0;
        return bitno(b);