arm64/abi: fix big aggregates passed on the stack
The riscv test abi8.ssa caught a bug in the arm backend. It turns out we were using the wrong class when loading pointers to aggregates from the stack. The fix is simple and mirrors what is done in the riscv abi.
This commit is contained in:
parent
c7842d84da
commit
905e9cef30
1 changed files with 4 additions and 8 deletions
12
arm64/abi.c
12
arm64/abi.c
|
@ -100,6 +100,9 @@ typclass(Class *c, Typ *t, int *gp, int *fp)
|
||||||
* memory */
|
* memory */
|
||||||
c->class |= Cptr;
|
c->class |= Cptr;
|
||||||
c->size = 8;
|
c->size = 8;
|
||||||
|
c->ngp = 1;
|
||||||
|
*c->reg = *gp;
|
||||||
|
*c->cls = Kl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,14 +233,7 @@ argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env)
|
||||||
case Oparc:
|
case Oparc:
|
||||||
case Oargc:
|
case Oargc:
|
||||||
typclass(c, &typ[i->arg[0].val], gp, fp);
|
typclass(c, &typ[i->arg[0].val], gp, fp);
|
||||||
if (c->class & Cptr) {
|
if (c->ngp <= ngp) {
|
||||||
if (ngp > 0) {
|
|
||||||
ngp--;
|
|
||||||
*c->reg = *gp++;
|
|
||||||
*c->cls = Kl;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else if (c->ngp <= ngp) {
|
|
||||||
if (c->nfp <= nfp) {
|
if (c->nfp <= nfp) {
|
||||||
ngp -= c->ngp;
|
ngp -= c->ngp;
|
||||||
nfp -= c->nfp;
|
nfp -= c->nfp;
|
||||||
|
|
Loading…
Add table
Reference in a new issue