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:
Quentin Carbonneaux 2015-08-15 20:49:20 -04:00
parent abbe53285f
commit bccfc34ca3
2 changed files with 6 additions and 1 deletions

View file

@ -173,6 +173,8 @@ eins(Ins i, Fn *fn, FILE *f)
eop(otoa[i.op], i.arg[1], i.to, fn, f);
break;
case OCopy:
if (req(i.to, R))
break;
if (i.to.val < EAX && rtype(i.arg[0]) == RCon) {
val = fn->con[i.arg[0].val].val;
if (0 <= val && val <= UINT32_MAX) {