1
0
mirror of https://github.com/golang/go synced 2024-11-21 21:04:41 -07:00

8g: fix build on Plan 9

8g/cgen.c:
8g/gobj.c
. dropped unnecessary assignments;
8g/gg.h
. added varargckk pragmas;
8g/ggen.c
. dropped duplicate assignment;
8g/gsubr.c
. adjusted format in print statement;
. dropped unnecessary assignment;
. replaced GCC's _builtin_return_address(0) with Plan 9's
  getcallerpc(&n) which is defined as a macro in <u.h>;
8g/list.c
. adjusted format in snprint statement;
8g/opt.h
. added varargck pragma (Adr*) that is specific for the invoking
  modules;
8g/peep.c
. dropped unnecessary incrementation;

R=rsc
CC=golang-dev
https://golang.org/cl/4974044
This commit is contained in:
Lucio De Re 2011-08-26 17:42:59 -04:00 committed by Russ Cox
parent 26608d4fbb
commit f6a9807f56
8 changed files with 7 additions and 12 deletions

View File

@ -682,7 +682,6 @@ agen(Node *n, Node *res)
break;
case ODOT:
t = nl->type;
agen(nl, res);
if(n->xoffset != 0) {
nodconst(&n1, types[tptr], n->xoffset);
@ -800,9 +799,6 @@ bgen(Node *n, int true, Prog *to)
if(n->ninit != nil)
genlist(n->ninit);
nl = n->left;
nr = n->right;
if(n->type == T) {
convlit(&n, types[TBOOL]);
if(n->type == T)
@ -815,7 +811,6 @@ bgen(Node *n, int true, Prog *to)
patch(gins(AEND, N, N), to);
return;
}
nl = N;
nr = N;
switch(n->op) {

View File

@ -179,3 +179,5 @@ void listinit(void);
void zaddr(Biobuf*, Addr*, int, int);
#pragma varargck type "D" Addr*
#pragma varargck type "lD" Addr*

View File

@ -431,7 +431,6 @@ hard:
if(nr->ullman >= nl->ullman || nl->addable) {
mgen(nr, &n2, N);
nr = &n2;
nr = &n2;
} else {
tempname(&n2, nr->type);
cgen(nr, &n2);

View File

@ -630,7 +630,6 @@ out:
// but 6l has a bug, and it can't handle
// JMP instructions too close to the top of
// a new function.
p = pc;
gins(ANOP, N, N);
}

View File

@ -825,7 +825,7 @@ regalloc(Node *n, Type *t, Node *o)
fprint(2, "registers allocated at\n");
for(i=D_AX; i<=D_DI; i++)
fprint(2, "\t%R\t%#ux\n", i, regpc[i]);
fprint(2, "\t%R\t%#lux\n", i, regpc[i]);
yyerror("out of fixed registers");
goto err;
@ -835,7 +835,6 @@ regalloc(Node *n, Type *t, Node *o)
goto out;
}
yyerror("regalloc: unknown type %T", t);
i = 0;
err:
nodreg(n, t, 0);
@ -845,7 +844,7 @@ out:
if (i == D_SP)
print("alloc SP\n");
if(reg[i] == 0) {
regpc[i] = (ulong)__builtin_return_address(0);
regpc[i] = (ulong)getcallerpc(&n);
if(i == D_AX || i == D_CX || i == D_DX || i == D_SP) {
dump("regalloc-o", o);
fatal("regalloc %R", i);

View File

@ -130,7 +130,7 @@ Dconv(Fmt *fp)
if(fp->flags & FmtLong) {
d1 = a->offset;
d2 = a->offset2;
snprint(str, sizeof(str), "$%ud-%ud", (ulong)d1, (ulong)d2);
snprint(str, sizeof(str), "$%lud-%lud", (ulong)d1, (ulong)d2);
break;
}
snprint(str, sizeof(str), "$%d", a->offset);

View File

@ -162,3 +162,5 @@ int32 RtoB(int);
int32 FtoB(int);
int BtoR(int32);
int BtoF(int32);
#pragma varargck type "D" Adr*

View File

@ -884,7 +884,6 @@ loop:
if(p->from.dval == p0->from.dval)
if(p->from.index == p0->from.index) {
excise(r);
t++;
goto loop;
}
break;