]> Cypherpunks repositories - gostls13.git/commitdiff
bug right shifting 64 bits
authorKen Thompson <ken@golang.org>
Fri, 22 Oct 2010 01:15:00 +0000 (18:15 -0700)
committerKen Thompson <ken@golang.org>
Fri, 22 Oct 2010 01:15:00 +0000 (18:15 -0700)
by a variable that equals 32

R=rsc
CC=golang-dev
https://golang.org/cl/2645042

src/cmd/5g/cgen64.c

index a22f4a548c9fa13b9f8a35d815b45367ec0bcd26..716ec5ed5b565f4824d1f4813c930f4638bab100 100644 (file)
@@ -439,12 +439,12 @@ olsh_break:
                p3 = gbranch(ABLO, T);
 
                // shift == 32
+               p1 = gins(AMOVW, &bh, &al);
+               p1->scond = C_SCOND_EQ;
                if(bh.type->etype == TINT32)
                        p1 = gshift(AMOVW, &bh, SHIFT_AR, 31, &ah);
                else
-                       p1 = gins(AEOR, &al, &al);
-               p1->scond = C_SCOND_EQ;
-               p1 = gins(AMOVW, &bh, &al);
+                       p1 = gins(AEOR, &ah, &ah);
                p1->scond = C_SCOND_EQ;
                p4 = gbranch(ABEQ, T);