aboutsummaryrefslogtreecommitdiffhomepage
path: root/amd64
diff options
context:
space:
mode:
Diffstat (limited to 'amd64')
-rw-r--r--amd64/emit.c4
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;