make sure eflags-writing do not disappear
This is a hack implementation, ideally I would like something cleaner. The problem is that regalloc thinks an instruction is dead code because it's not aware that it writes to eflags.
This commit is contained in:
parent
abbe53285f
commit
bccfc34ca3
2 changed files with 6 additions and 1 deletions
|
@ -318,8 +318,11 @@ seljmp(Blk *b, Fn *fn)
|
|||
selcmp(fi->arg, fn);
|
||||
*fi = (Ins){ONop, R, {R, R}};
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
if (fn->tmp[r.val].nuse == 1)
|
||||
emit(OCopy, R, r, R);
|
||||
b->jmp.type = JXJc + Cne;
|
||||
}
|
||||
} else {
|
||||
selcmp((Ref[2]){r, CON_Z}, fn);
|
||||
b->jmp.type = JXJc + Cne;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue