|
|
@@ -656,9 +656,9 @@ void
|
|
|
amd64_sysv_abi(Fn *fn)
|
|
|
{
|
|
|
Blk *b;
|
|
|
- Ins *i, *i0, *ip;
|
|
|
+ Ins *i, *i0;
|
|
|
RAlloc *ral;
|
|
|
- int n, fa;
|
|
|
+ int n0, n1, ioff, fa;
|
|
|
|
|
|
for (b=fn->start; b; b=b->link)
|
|
|
b->visit = 0;
|
|
|
@@ -668,12 +668,13 @@ amd64_sysv_abi(Fn *fn)
|
|
|
if (!ispar(i->op))
|
|
|
break;
|
|
|
fa = selpar(fn, b->ins, i);
|
|
|
- n = b->nins - (i - b->ins) + (&insb[NIns] - curi);
|
|
|
- i0 = vnew(n, sizeof(Ins), PFn);
|
|
|
- ip = icpy(ip = i0, curi, &insb[NIns] - curi);
|
|
|
- ip = icpy(ip, i, &b->ins[b->nins] - i);
|
|
|
- b->nins = n;
|
|
|
- b->ins = i0;
|
|
|
+ n0 = &insb[NIns] - curi;
|
|
|
+ ioff = i - b->ins;
|
|
|
+ n1 = b->nins - ioff;
|
|
|
+ vgrow(&b->ins, n0+n1);
|
|
|
+ icpy(b->ins+n0, b->ins+ioff, n1);
|
|
|
+ icpy(b->ins, curi, n0);
|
|
|
+ b->nins = n0+n1;
|
|
|
|
|
|
/* lower calls, returns, and vararg instructions */
|
|
|
ral = 0;
|