]> Cypherpunks repositories - gostls13.git/commitdiff
5g, 8g: dead code (already removed from 6g)
authorRuss Cox <rsc@golang.org>
Thu, 12 Aug 2010 04:58:29 +0000 (21:58 -0700)
committerRuss Cox <rsc@golang.org>
Thu, 12 Aug 2010 04:58:29 +0000 (21:58 -0700)
R=ken2
CC=golang-dev
https://golang.org/cl/1983041

src/cmd/5g/ggen.c
src/cmd/8g/ggen.c

index 0d87895240eb7141eb7ecfa063700c90d591794a..328d3284da23d8d5211bcb45d544c092940aceba 100644 (file)
@@ -733,7 +733,7 @@ getargs(NodeList *nn, Node *reg, int n)
 void
 cmpandthrow(Node *nl, Node *nr)
 {
-       vlong cl, cr;
+       vlong cl;
        Prog *p1;
        int op;
        Node *c, n1, n2;
@@ -743,17 +743,8 @@ cmpandthrow(Node *nl, Node *nr)
                cl = mpgetfix(nl->val.u.xval);
                if(cl == 0)
                        return;
-               if(smallintconst(nr)) {
-                       cr = mpgetfix(nr->val.u.xval);
-                       if(cl > cr) {
-                               if(throwpc == nil) {
-                                       throwpc = pc;
-                                       ginscall(panicslice, 0);
-                               } else
-                                       patch(gbranch(AB, T), throwpc);
-                       }
+               if(smallintconst(nr))
                        return;
-               }
 
                // put the constant on the right
                op = brrev(op);
index 983c17f44feca1e44fa9fd0e8b9efc1ebcbfaf7b..40f348c7d82bfd4f511d29b911be0afba5220fa8 100644 (file)
@@ -854,7 +854,7 @@ getargs(NodeList *nn, Node *reg, int n)
 void
 cmpandthrow(Node *nl, Node *nr)
 {
-       vlong cl, cr;
+       vlong cl;
        Prog *p1;
        int op;
        Node *c;
@@ -864,18 +864,8 @@ cmpandthrow(Node *nl, Node *nr)
                cl = mpgetfix(nl->val.u.xval);
                if(cl == 0)
                        return;
-               if(smallintconst(nr)) {
-                       cr = mpgetfix(nr->val.u.xval);
-                       if(cl > cr) {
-                               if(throwpc == nil) {
-                                       throwpc = pc;
-                                       ginscall(panicslice, 0);
-                               } else
-                                       patch(gbranch(AJMP, T), throwpc);
-                       }
+               if(smallintconst(nr))
                        return;
-               }
-
                // put the constant on the right
                op = brrev(op);
                c = nl;