diff options
| author | 2023-06-20 08:27:28 +0200 | |
|---|---|---|
| committer | 2023-06-20 08:27:28 +0200 | |
| commit | 981906a54e6c8dd727b7b6be2a428c547877ef78 (patch) | |
| tree | 276649fdef643961c06dd051e1da7c2889ea4ece /amd64 | |
| parent | 7929d58d92f3a5624b0e61b842ba5ce8debb3550 (diff) | |
errata
Diffstat (limited to 'amd64')
| -rw-r--r-- | amd64/emit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/amd64/emit.c b/amd64/emit.c index e9561d3..c7c6258 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -582,10 +582,11 @@ static void gencopy(uchar **pcode, enum irclass cls, struct block *blk, int curi, struct oper dst, union ref val) { assert(dst.t == OREG); - if (val.t == RMORE && !flagslivep(blk, curi)) { + if (val.t == RMORE) { /* this is a LEA, but maybe it can be lowered to a 2-address instruction, * which may clobber flags */ const struct addr *addr = &addrht[val.i]; + if (flagslivep(blk, curi)) goto Lea; if (addr->base.t && dst.reg == mkregoper(addr->base).reg) { /* base = dst */ if (addr->index.t && !addr->disp && !addr->shift){ /* lea Rx, [Rx + Ry] -> add Rx, Ry */ @@ -856,7 +857,6 @@ emitbin(struct function *fn) uchar **pcode = &objout.code; uchar *start; - if (nblkaddr < fn->nblk) { blkaddr = xrealloc(blkaddr, fn->nblk * sizeof *blkaddr); nblkaddr = fn->nblk; |