diff options
| author | 2025-12-19 12:24:52 +0100 | |
|---|---|---|
| committer | 2025-12-19 12:24:52 +0100 | |
| commit | 95c43247e02b12c86114d53e95eec2c4988a9e03 (patch) | |
| tree | e40244e32ce4cb92b9a0fd71332d30c7acda7ac4 | |
| parent | e81ff5af7608f12530df3f6f016e2532e71a78b7 (diff) | |
isel: fix wrong instr cls being used in some cases
Specifically comparisons where operation cls != result cls
| -rw-r--r-- | x86_64/isel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/x86_64/isel.c b/x86_64/isel.c index 22a1290..19692ed 100644 --- a/x86_64/isel.c +++ b/x86_64/isel.c @@ -429,7 +429,7 @@ sel(struct function *fn, struct instr *ins, struct block *blk, int *curi) rswap(ins->l, ins->r); } if (ins->l.t != RTMP && ins->l.t != RREG) - ins->l = insertinstr(blk, (*curi)++, mkinstr(Ocopy, ins->cls, ins->l)); + ins->l = insertinstr(blk, (*curi)++, mkinstr(Ocopy, insrescls(*ins), ins->l)); else fixarg(&ins->l, ins, blk, curi); fixarg(&ins->r, ins, blk, curi); @@ -589,7 +589,7 @@ seljmp(struct function *fn, struct block *blk) if (!(opflags[instrtab[c.i].op] & ZF) || blk->ins.n == 0 || c.i != blk->ins.p[blk->ins.n - 1]) { struct instr *ins; int curi = blk->ins.n; - blk->jmp.arg[0] = insertinstr(blk, blk->ins.n, mkinstr(Oneq, instrtab[c.i].cls, c, ZEROREF)); + blk->jmp.arg[0] = insertinstr(blk, blk->ins.n, mkinstr(Oneq, insrescls(instrtab[c.i]), c, ZEROREF)); ins = &instrtab[blk->jmp.arg[0].i]; if (kisflt(ins->cls)) { ins->r = insertinstr(blk, curi, mkinstr(Ocopy, ins->cls, ZEROREF)); |