aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
author lemon<lsof@mailbox.org>2025-12-10 09:57:22 +0100
committer lemon<lsof@mailbox.org>2025-12-10 09:57:22 +0100
commit15cf067c4e65c1728c48ab049d48219daa436265 (patch)
tree3dcac9f8a85cc9c9f5c2ecc62963800084124274
parent600d94645e128dc88fdb9a2b6d42a5b49a138fd5 (diff)
misc fixes
-rw-r--r--amd64/emit.c5
-rw-r--r--common.h2
-rw-r--r--ir/regalloc.c2
3 files changed, 4 insertions, 5 deletions
diff --git a/amd64/emit.c b/amd64/emit.c
index e188782..8f29cfc 100644
--- a/amd64/emit.c
+++ b/amd64/emit.c
@@ -1187,10 +1187,9 @@ emitbranch(uchar **pcode, struct block *blk)
if (blk->s2) {
/* conditional branch.. */
union ref arg = blk->jmp.arg[0];
- struct instr *ins;
- struct block *unord;
+ struct block *unord = NULL;
assert(arg.t == RTMP);
- ins = &instrtab[arg.i];
+ struct instr *ins = &instrtab[arg.i];
if ((oiscmp(ins->op) || ins->op == Oand || ins->op == Osub)) {
if (ins->r.bits != ZEROREF.bits) {
/* for CMP instr */
diff --git a/common.h b/common.h
index 77d24c4..26e4b61 100644
--- a/common.h
+++ b/common.h
@@ -79,7 +79,7 @@ ispo2(uvlong x) {
static inline uint
ilog2(uvlong x) { /* assumes x is a power of 2 */
#if HAS_BUILTIN(ctz)
- return __builtin_ctz(x);
+ return __builtin_ctzll(x);
#else
uint n = 0;
while (x >>= 1) ++n;
diff --git a/ir/regalloc.c b/ir/regalloc.c
index 520870e..3642d36 100644
--- a/ir/regalloc.c
+++ b/ir/regalloc.c
@@ -147,7 +147,7 @@ struct interval {
fpr : 1; /* needs float register? */
/* sorted ranges array */
- uchar nrange;
+ uint nrange;
union {
struct range _inl[2];
struct range *_dyn;