diff options
| author | 2026-02-28 20:38:55 +0100 | |
|---|---|---|
| committer | 2026-02-28 20:38:55 +0100 | |
| commit | f06da11d8524a9eb7fe984171d4462cef8eac2e6 (patch) | |
| tree | 0050bede4ec0e9939e4a5f98be089a539d5810d2 /x86_64 | |
| parent | 3d1efdcc77de5ce8f3279bd22b0a510a699229ea (diff) | |
ir: make address ref hash table resizable
Would hit the limit on very large functions (thanks csmith).
Diffstat (limited to 'x86_64')
| -rw-r--r-- | x86_64/emit.c | 4 | ||||
| -rw-r--r-- | x86_64/isel.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/x86_64/emit.c b/x86_64/emit.c index e54b7dd..5dbbed1 100644 --- a/x86_64/emit.c +++ b/x86_64/emit.c @@ -127,7 +127,7 @@ mkmemoper(union ref r) assert(wop.t == OREG); return mkoper(OMEM, .base = wop.reg, .index = NOINDEX); } else if (r.t == RADDR) { - const struct addr *addr = &addrht[r.i]; + const struct addr *addr = &addrtab.p[r.i]; assert(addr->shift <= 3); if (isaddrcon(addr->base,0)) { return mkoper(OSYM, .con = addr->base.i, @@ -835,7 +835,7 @@ gencopy(uchar **pcode, enum irclass cls, struct block *blk, int curi, struct ope if (val.t == RADDR) { /* 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]; + const struct addr *addr = &addrtab.p[val.i]; if (flagslivep(blk, curi)) goto Lea; if (addr->base.t != RREG) goto Lea; if (addr->base.bits && dst.reg == mkregoper(addr->base).reg) { /* base = dst */ diff --git a/x86_64/isel.c b/x86_64/isel.c index 637df7e..fffc4c9 100644 --- a/x86_64/isel.c +++ b/x86_64/isel.c @@ -248,7 +248,7 @@ aadd(struct addr *addr, struct block *blk, int *curi, union ref r) if (!ascale(addr, ins->l, ins->r)) goto Ref; ins->skip = 1; } else if (ins->op == Ocopy && ins->l.t == RADDR) { - struct addr save = *addr, *addr2 = &addrht[ins->l.i]; + struct addr save = *addr, *addr2 = &addrtab.p[ins->l.i]; if ((!addr2->base.bits || aadd(addr, blk, curi, addr2->base)) && aimm(addr, addr2->disp) && (!addr2->index.bits || ascale(addr, addr2->index, mkref(RICON, addr2->shift)))) @@ -290,7 +290,7 @@ fuseaddr(union ref *r, struct block *blk, int *curi) if (isaddrcon(*r,1)) return 1; if (r->t == RADDR) { - const struct addr *a0 = &addrht[r->i]; + const struct addr *a0 = &addrtab.p[r->i]; if (aadd(&addr, blk, curi, a0->base) && (!addr.index.bits || ascale(&addr, a0->index, mkref(RICON, a0->shift))) && aadd(&addr, blk, curi, mkintcon(KPTR, a0->disp))) { |