]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.power64] cmd/9g: correct floating point comparison
authorRuss Cox <rsc@golang.org>
Thu, 14 Aug 2014 18:34:37 +0000 (14:34 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 14 Aug 2014 18:34:37 +0000 (14:34 -0400)
LGTM=minux
R=minux
CC=golang-codereviews
https://golang.org/cl/129210043

src/cmd/9g/cgen.c

index 6bb44f547c74468ff6402a9db5b8b5397dccaf17..86a56975ade141c2460afa624df7b7564e1d0fcc 100644 (file)
@@ -1267,9 +1267,9 @@ bgen(Node *n, int true, int likely, Prog *to)
                l = &n1;
                r = &n2;
                gins(optoas(OCMP, nr->type), l, r);
-               if(isfloat[nr->type->etype] && (n->op == OLE || n->op == OGE)) {
+               if(isfloat[nr->type->etype] && (a == OLE || a == OGE)) {
                        // To get NaN right, must rewrite x <= y into separate x < y or x = y.
-                       switch(n->op) {
+                       switch(a) {
                        case OLE:
                                a = OLT;
                                break;