shithub: scc

Download patch

ref: b50a3944fd28e8e2e607edf3836df821e0a49c0e
parent: fa31b3c3f732be9e1b96552c9d63380fe1c65886
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Mar 20 15:24:52 EDT 2015

Fix bug in allocreg()

The test of the loop was done in np instead of
doing it in r, that was the node pointer of
the register.

--- a/cc2/cgen.c
+++ b/cc2/cgen.c
@@ -106,7 +106,7 @@
 	}
 	for (bp = ary; c = *bp; ++bp) {
 		r = reguse[c];
-		if (np && !np->used)
+		if (r && !r->used)
 			continue;
 		moveto(np, c);
 	}