scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit b50a3944fd28e8e2e607edf3836df821e0a49c0e
parent fa31b3c3f732be9e1b96552c9d63380fe1c65886
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 20 Mar 2015 19:24:52 -0400

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.

Diffstat:
Mcc2/cgen.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

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