aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--aarch64/emit.c6
-rw-r--r--c/lex.c2
-rw-r--r--ir/fold.c13
-rw-r--r--ir/ir.c2
-rw-r--r--ir/stack.c1
-rw-r--r--x86_64/isel.c1
6 files changed, 11 insertions, 14 deletions
diff --git a/aarch64/emit.c b/aarch64/emit.c
index 6db1bd6..3fd3278 100644
--- a/aarch64/emit.c
+++ b/aarch64/emit.c
@@ -759,7 +759,7 @@ emitinstr(uchar **pcode, struct function *fn, struct block *blk, int curi, struc
break;
case Oshl:
if (ins->r.t == RICON) {
- uint nbit = cls == KI32 ? 32 : 64, s = ins->r.i & nbit-1;
+ uint nbit = cls == KI32 ? 32 : 64, s = ins->r.i & (nbit-1);
assert(s > 0);
Xubfm(pcode, cls, reg2oper(ins->reg-1), ref2oper(ins->l), nbit-s, nbit-s-1);
} else {
@@ -769,7 +769,7 @@ emitinstr(uchar **pcode, struct function *fn, struct block *blk, int curi, struc
break;
case Oslr:
if (ins->r.t == RICON) {
- uint nbit = cls == KI32 ? 32 : 64, s = ins->r.i & nbit-1;
+ uint nbit = cls == KI32 ? 32 : 64, s = ins->r.i & (nbit-1);
assert(s > 0);
Xubfm(pcode, cls, reg2oper(ins->reg-1), ref2oper(ins->l), s, nbit-1);
} else {
@@ -779,7 +779,7 @@ emitinstr(uchar **pcode, struct function *fn, struct block *blk, int curi, struc
break;
case Osar:
if (ins->r.t == RICON) {
- uint nbit = cls == KI32 ? 32 : 64, s = ins->r.i & nbit-1;
+ uint nbit = cls == KI32 ? 32 : 64, s = ins->r.i & (nbit-1);
assert(s > 0);
Xsbfm(pcode, cls, reg2oper(ins->reg-1), ref2oper(ins->l), s, nbit-1);
} else {
diff --git a/c/lex.c b/c/lex.c
index a2f1596..de58900 100644
--- a/c/lex.c
+++ b/c/lex.c
@@ -722,7 +722,7 @@ delmac(internstr name)
pmap_del(&macroht, name);
}
-static internstr
+static inline internstr
macname(struct macro *mac)
{
return macroht.mb.k[mac - macroht.v];
diff --git a/ir/fold.c b/ir/fold.c
index f5150c0..321797b 100644
--- a/ir/fold.c
+++ b/ir/fold.c
@@ -71,15 +71,14 @@ foldflt(enum op op, enum irclass k, union ref lr, union ref rr)
case Osub: x = l - r; break;
case Omul: x = l * r; break;
case Odiv: x = l / r; break;
- case Oequ: xi = l == r; break;
- case Oneq: xi = l != r; break;
- case Olth: xi = l < r; break;
- case Ogth: xi = l > r; break;
- case Olte: xi = l <= r; break;
- case Ogte: xi = l >= r; break;
+ case Oequ: xi = l == r; goto Cmp;
+ case Oneq: xi = l != r; goto Cmp;
+ case Olth: xi = l < r; goto Cmp;
+ case Ogth: xi = l > r; goto Cmp;
+ case Olte: xi = l <= r; goto Cmp;
+ case Ogte: xi = l >= r; Cmp: return mkref(RICON, xi);
default: assert(0);
}
- if (oiscmp(op)) return mkref(RICON, xi);
if (!w) x = (float)x;
return mkfltcon(k, x);
}
diff --git a/ir/ir.c b/ir/ir.c
index b5f9de8..136935f 100644
--- a/ir/ir.c
+++ b/ir/ir.c
@@ -663,7 +663,7 @@ irfini(struct function *fn)
if (objout.code)
mctarg->emit(fn);
-Fin:
+//Fin:
freearena(fn->passarena);
freefn(fn);
}
diff --git a/ir/stack.c b/ir/stack.c
index 45023d1..1dc29cd 100644
--- a/ir/stack.c
+++ b/ir/stack.c
@@ -3,7 +3,6 @@
void
lowerstack(struct function *fn)
{
- extern int ninstr;
fn->stksiz = 0;
FREQUIRE(FNUSE);
diff --git a/x86_64/isel.c b/x86_64/isel.c
index a8f55c6..c4c78b8 100644
--- a/x86_64/isel.c
+++ b/x86_64/isel.c
@@ -385,7 +385,6 @@ sel(struct function *fn, struct instr *ins, struct block *blk, int *curi)
case Ocall:
selcall(fn, ins, blk, curi);
break;
- case Ocall2r: assert(0);
case Ointrin:
break;
case Oshl: case Osar: case Oslr: