shithub: riscv

Download patch

ref: 74a557a167533d37ddd551c2d222fe208c5a4302
parent: cde69a78225ee3b8c5e46ddb98ce4bd599d4f355
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Oct 3 08:18:20 EDT 2015

8c: make cgen64() compile target first when it contains functoin call so final assignment wont trash the registers

--- a/sys/src/cmd/8c/cgen64.c
+++ b/sys/src/cmd/8c/cgen64.c
@@ -1575,6 +1575,13 @@
 	cmp = 0;
 	sh = 0;
 
+	if(nn != Z && nn->complex >= FNX){
+		reglcgen(&nod1, nn, Z);
+		m = cgen64(n, &nod1);
+		regfree(&nod1);
+		return m;
+	}
+
 	switch(n->op) {
 	case ONEG:
 		d = regpair(nn, n);