aboutsummaryrefslogtreecommitdiffhomepage
path: root/amd64
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-11-02 19:25:03 +0100
committerlemon <lsof@mailbox.org>2025-11-02 19:25:03 +0100
commit812bb36e322c36719e66ce8443ff583058d53461 (patch)
tree568bb2fa300f7e4c6c059364c2269cc8cedc2c6f /amd64
parentfcf64a37f468eac24d4762470fb77c94bcb36005 (diff)
isel: fix 3-address add when used for flags in branch
Diffstat (limited to 'amd64')
-rw-r--r--amd64/isel.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/amd64/isel.c b/amd64/isel.c
index 49efce8..133868e 100644
--- a/amd64/isel.c
+++ b/amd64/isel.c
@@ -477,6 +477,9 @@ seljmp(struct function *fn, struct block *blk)
ins->r = insertinstr(blk, curi, mkinstr(Ocopy, ins->cls, ZEROREF));
}
ins->keep = 1;
+ } else if (instrtab[c.i].op == Oadd) {
+ /* prevent a 3-address add whose flag results are used from becoming a LEA */
+ instrtab[c.i].inplace = 1;
}
}
} else if (blk->jmp.t == Jret) {