]> Cypherpunks repositories - gostls13.git/commitdiff
bug 155
authorKen Thompson <ken@golang.org>
Fri, 29 May 2009 21:42:24 +0000 (14:42 -0700)
committerKen Thompson <ken@golang.org>
Fri, 29 May 2009 21:42:24 +0000 (14:42 -0700)
R=r
OCL=29619
CL=29619

src/cmd/6g/ggen.c
test/fixedbugs/bug155.go [moved from test/bugs/bug155.go with 100% similarity]
test/golden.out

index 06b0f8003f1be6eb7b9761adbb5b4f812839c4f0..b92d24ebcd88a36cc0b6e1ab62992799d1745ec7 100644 (file)
@@ -557,13 +557,15 @@ cgen_shift(int op, Node *nl, Node *nr, Node *res)
        Node n1, n2, n3;
        int a;
        Prog *p1;
+       uvlong sc;
 
        a = optoas(op, nl->type);
 
        if(nr->op == OLITERAL) {
                regalloc(&n1, nl->type, res);
                cgen(nl, &n1);
-               if(mpgetfix(nr->val.u.xval) >= nl->type->width*8) {
+               sc = mpgetfix(nr->val.u.xval);
+               if(sc >= nl->type->width*8) {
                        // large shift gets 2 shifts by width
                        nodconst(&n3, types[TUINT32], nl->type->width*8-1);
                        gins(a, &n3, &n1);
similarity index 100%
rename from test/bugs/bug155.go
rename to test/fixedbugs/bug155.go
index 98348e753a676552b243257586712cab488e31d2..46b4fb220998748cd36d1afa15d267e876b1d028 100644 (file)
@@ -104,12 +104,6 @@ BUG should compile
 5 7
 BUG: should crash
 
-=========== bugs/bug155.go
-main·f: doasm: notfound from=75 to=13 (82)    SHLQ    $-9223372036854775808,BX
-main·f: doasm: notfound from=75 to=13 (82)    SHLQ    $-9223372036854775808,BX
-main·f: doasm: notfound from=75 to=13 (82)    SHLQ    $-9223372036854775808,BX
-BUG: bug155
-
 =========== bugs/bug156.go
 bugs/bug156.go:7: constant 18446744073709551615 overflows int64
 BUG: bug156