scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 348cbf56cdf4a39bf18b451ecd32e2df57b86fb1
parent 7c88dc7a0c96e24b53b0aeea66d74b3a757be2d4
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 12 Feb 2015 12:47:55 +0100

Mark the node with the correct register in add

When an operation is performed and the result is stored in some
register, then we have to update the node to register, because in
other case it is not possible to know where is located the result.

Diffstat:
cc2/cgen.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/cc2/cgen.c b/cc2/cgen.c @@ -138,6 +138,8 @@ cgen(Node *np, Node *parent) code(LD, A, lp->u.reg); } code(ADD, A, rp->u.reg); + np->op = REG; + np->u.reg = A; break; case 2: if (rp->u.reg == HL || rp->u.reg == IY) {