scc

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

commit cb298cbc11907baaac115e312d8a875420f2ecbf
parent 12586fdbde8bc3b7715a93dadf32a051699c04c8
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue,  7 Jun 2016 09:36:31 +0200

[cc2-qbe] Improve ternary() in cgen.c

There was a bit of garbage from previous changes.

Diffstat:
Mcc2/arch/qbe/cgen.c | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/cc2/arch/qbe/cgen.c b/cc2/arch/qbe/cgen.c @@ -319,7 +319,7 @@ static Node * ternary(Node *np) { Symbol *yes, *no, *phi; - Node *ifyes, *ifno, *phinode, *yesval, *colon; + Node *ifyes, *ifno, *phinode, *colon; tmpnode(np); phi = newlabel(); @@ -332,8 +332,7 @@ ternary(Node *np) colon = np->right; cgen(np->left); - load(np, LOADL); - code(ASBRANCH, np->left, ifyes, ifno); + code(ASBRANCH, load(np, LOADL), ifyes, ifno); setlabel(yes); cgen(colon->left);