commit 6cba2db94922c6542d0de7e4f4d4a2323a6d9981
parent 7e1db6cc659dc701391639a40790645940a53879
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date: Wed, 16 Mar 2016 10:57:41 -0400
document oddity in seljmp()
Diffstat:
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/lisc/isel.c b/lisc/isel.c
@@ -397,10 +397,14 @@ seljmp(Blk *b, Fn *fn)
}
return;
}
- if (fn->tmp[r.val].nuse > 1) {
- b->jmp.type = JXJc + ICne;
- return;
- }
+ /* since flags are not tracked in liveness,
+ * the result of the flag-setting instruction
+ * has to be marked as live
+ */
+ if (fn->tmp[r.val].nuse == 1)
+ emit(OCopy, Kw, R, r, R);
+ b->jmp.type = JXJc + ICne;
+ return;
}
selcmp((Ref[2]){r, CON_Z}, Kw, fn); /* todo, add long branch if non-zero */
b->jmp.type = JXJc + ICne;