goto ret;
sse:
- if(nr->ullman >= UINF) {
- if(!nl->addable) {
- tempname(&n1, nl->type);
- cgen(nl, &n1);
- nl = &n1;
- }
- if(!nr->addable) {
- tempname(&tmp, nr->type);
- cgen(nr, &tmp);
- nr = &tmp;
- }
- regalloc(&n2, nr->type, N);
- cgen(nr, &n2);
- nr = &n2;
- goto ssecmp;
- }
-
if(!nl->addable) {
tempname(&n1, nl->type);
cgen(nl, &n1);
nl = &n1;
}
-
if(!nr->addable) {
tempname(&tmp, nr->type);
cgen(nr, &tmp);
nr = &tmp;
}
-
regalloc(&n2, nr->type, N);
gmove(nr, &n2);
nr = &n2;
nl = &n3;
}
-ssecmp:
if(a == OGE || a == OGT) {
// only < and <= work right with NaN; reverse if needed
r = nr;
--- /dev/null
+// run
+
+// Copyright 2013 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// issue 4785: used to fail to compile
+
+package main
+
+func t(x, y interface{}) interface{} {
+ return x.(float64) > y.(float64)
+}
+
+func main() {
+ v := t(1.0, 2.0)
+ if v != false {
+ panic("bad comparison")
+ }
+}