From 81e54561e935e41fed0232a798a7f9264c8b93fb Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 14 Aug 2014 14:34:37 -0400 Subject: [dev.power64] cmd/9g: correct floating point comparison LGTM=minux R=minux CC=golang-codereviews https://codereview.appspot.com/129210043 --- src/cmd/9g/cgen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/9g/cgen.c b/src/cmd/9g/cgen.c index 6bb44f547..86a56975a 100644 --- a/src/cmd/9g/cgen.c +++ b/src/cmd/9g/cgen.c @@ -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; -- cgit v1.2.1