aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2026-04-12 13:02:22 +0200
committerlemon <lsof@mailbox.org>2026-04-12 13:02:22 +0200
commit5886346cf680c5011de282d00c6f0b2d10431171 (patch)
tree1d63565e6bfa5e0522d534e8bbae6b12a2509bab
parentd23aeebff59a762b718fa46de96a8c2e23b6c3f7 (diff)
get rid of other warnings
-rw-r--r--src/t_aarch64_emit.c2
-rw-r--r--src/t_x86-64_emit.c7
2 files changed, 4 insertions, 5 deletions
diff --git a/src/t_aarch64_emit.c b/src/t_aarch64_emit.c
index b8eff85..60e37f3 100644
--- a/src/t_aarch64_emit.c
+++ b/src/t_aarch64_emit.c
@@ -993,7 +993,7 @@ prologue(uchar **pcode, Frame *frame, Function *fn)
frame->size += 16;
adr.m.disp -= fn->stksiz;
Xstp(pcode, KPTR, reg2oper(FP), reg2oper(LR), adr);
- Xadd(pcode, KPTR, reg2oper(R(29)), reg2oper(SP), mkoper(OIMM, {0})); /* MOV x29,sp */
+ Xadd(pcode, KPTR, reg2oper(R(29)), reg2oper(SP), mkoper(OIMM, .imm=0)); /* MOV x29,sp */
} else if (fn->stksiz) {
Xsub(pcode, KPTR, reg2oper(SP), reg2oper(SP), mkoper(OIMM, .imm = fn->stksiz + 8*frame->nsingle));
}
diff --git a/src/t_x86-64_emit.c b/src/t_x86-64_emit.c
index 6079f3c..06ad803 100644
--- a/src/t_x86-64_emit.c
+++ b/src/t_x86-64_emit.c
@@ -1344,7 +1344,6 @@ emitbin(Function *fn)
Block *blk;
uchar **pcode = &objout.code;
int npush = 0;
- bool saverestore;
nops(pcode, 16);
fnstart = *pcode;
@@ -1359,7 +1358,7 @@ emitbin(Function *fn)
/* push rbp; mov rbp, rsp */
DS("\x55\x48\x89\xE5");
}
- saverestore = npush = calleesave(pcode, fn);
+ npush = calleesave(pcode, fn);
/* ensure stack is 16-byte aligned */
if (frame.usebp) {
@@ -1439,9 +1438,9 @@ emitbin(Function *fn)
if (blk->lnext != fn->entry && blk->lnext->jmp.t == Jret && blk->lnext->ins.n == 0)
continue; /* fallthru to next blk's RET */
/* epilogue */
- if (fn->stksiz && saverestore && frame.usebp)
+ if (fn->stksiz > 0 && npush > 0 && frame.usebp)
Xadd(pcode, KPTR, mkoper(OREG, .reg = RSP), mkoper(OIMM, .imm = fn->stksiz));
- if (saverestore)
+ if (npush > 0)
calleerestore(pcode, fn);
if (frame.usebp) B(0xC9); /* leave */
B(0xC3); /* ret */