shithub: riscv

Download patch

ref: 9f6967ed7e12ec3254bc1b3b7ad3e5a41c274e3a
parent: 7d3cc1c55a435bd9e3d37d9bf8a9299ea9e1f87e
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Jun 24 15:25:13 EDT 2019

8c: skip 64-bit regpair allocation for OINDEX nodes in cgen64()

OINDEX can only return TLONG result on 386 so give it
a register instead of a regpair and let gmove() handle
the conversion.

--- a/sys/src/cmd/8c/cgen64.c
+++ b/sys/src/cmd/8c/cgen64.c
@@ -2526,7 +2526,7 @@
 	case OCAST:
 		l = n->left;
 		if(typev[l->type->etype]) {
-			if(!vaddr(l, 1)) {
+			if(!vaddr(l, 1) && l->op != OINDEX) {	// theres no 64 bit indexing
 				if(l->complex + 1 > nn->complex) {
 					d = regpair(Z, l);
 					sugen(l, d, 8);