1
0
mirror of https://github.com/golang/go synced 2024-10-05 14:01:21 -06:00

[dev.power64] cmd/9g, cmd/gc, cmd/ld: fix build.

1. disable nonsplit stack overflow check
2. disable OLROT recognition
3. emit correct instructions for adding offsets to an address

LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/123310043
This commit is contained in:
Shenghou Ma 2014-08-12 21:22:27 -04:00
parent 860f941e7f
commit 3e4dfdad34
3 changed files with 21 additions and 3 deletions

View File

@ -788,6 +788,18 @@ agenr(Node *n, Node *a, Node *res)
}
}
static void
ginsadd(int as, vlong off, Node *dst)
{
Node n1;
regalloc(&n1, types[tptr], dst);
gmove(dst, &n1);
ginscon(as, off, &n1);
gmove(&n1, dst);
regfree(&n1);
}
/*
* generate:
* res = &n;
@ -901,7 +913,7 @@ agen(Node *n, Node *res)
}
cgen(n->heapaddr, res);
if(n->xoffset != 0) {
ginscon(optoas(OADD, types[tptr]), n->xoffset, res);
ginsadd(optoas(OADD, types[tptr]), n->xoffset, res);
}
break;
@ -913,7 +925,7 @@ agen(Node *n, Node *res)
case ODOT:
agen(nl, res);
if(n->xoffset != 0) {
ginscon(optoas(OADD, types[tptr]), n->xoffset, res);
ginsadd(optoas(OADD, types[tptr]), n->xoffset, res);
}
break;
@ -921,7 +933,7 @@ agen(Node *n, Node *res)
cgen(nl, res);
cgen_checknil(res);
if(n->xoffset != 0) {
ginscon(optoas(OADD, types[tptr]), n->xoffset, res);
ginsadd(optoas(OADD, types[tptr]), n->xoffset, res);
}
break;
}

View File

@ -3217,6 +3217,9 @@ walkrotate(Node **np)
int w, sl, sr, s;
Node *l, *r;
Node *n;
if(thechar == '9')
return;
n = *np;

View File

@ -1045,6 +1045,9 @@ dostkcheck(void)
{
Chain ch;
LSym *s;
if(thechar == '9')
return;
morestack = linklookup(ctxt, "runtime.morestack", 0);
newstack = linklookup(ctxt, "runtime.newstack", 0);