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

5c, 6c, 6l: fix Plan 9 build warnings

src/cmd/5c/reg.c:
. Added USED() attribute.

src/cmd/6c/cgen.c:
. Revised code around "REGARG" to resemble use in "8c" and
  consequently remove a warning.

src/cmd/6l/asm.c:
. Added USED() attributes.
. Removed an unnecessary assignment.

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4836045
This commit is contained in:
Lucio De Re 2011-08-16 14:22:08 -04:00 committed by Russ Cox
parent 93ecb5bb1b
commit c8c6e1961d
3 changed files with 7 additions and 7 deletions

View File

@ -66,6 +66,7 @@ rcmp(const void *a1, const void *a2)
void void
regopt(Prog *p) regopt(Prog *p)
{ {
USED(p);
// TODO(kaib): optimizer disabled because it smashes R8 when running out of registers // TODO(kaib): optimizer disabled because it smashes R8 when running out of registers
// the disable is unconventionally here because the call is in common code shared by 5c/6c/8c // the disable is unconventionally here because the call is in common code shared by 5c/6c/8c
return; return;

View File

@ -930,9 +930,6 @@ cgen(Node *n, Node *nn)
return; return;
} }
o = 0;
if(REGARG >= 0)
o = reg[REGARG];
gargs(r, &nod, &nod1); gargs(r, &nod, &nod1);
if(l->addable < INDEXED) { if(l->addable < INDEXED) {
reglcgen(&nod, l, nn); reglcgen(&nod, l, nn);
@ -941,9 +938,8 @@ cgen(Node *n, Node *nn)
regfree(&nod); regfree(&nod);
} else } else
gopcode(OFUNC, n->type, Z, l); gopcode(OFUNC, n->type, Z, l);
if(REGARG >= 0) if(REGARG >= 0 && reg[REGARG])
if(o != reg[REGARG]) reg[REGARG]--;
reg[REGARG]--;
if(nn != Z) { if(nn != Z) {
regret(&nod, n); regret(&nod, n);
gmove(&nod, nn); gmove(&nod, nn);

View File

@ -298,6 +298,9 @@ adddynrel(Sym *s, Reloc *r)
int int
archreloc(Reloc *r, Sym *s, vlong *val) archreloc(Reloc *r, Sym *s, vlong *val)
{ {
USED(r);
USED(s);
USED(val);
return -1; return -1;
} }
@ -859,7 +862,7 @@ asmb(void)
startva = INITTEXT - HEADR; startva = INITTEXT - HEADR;
/* This null SHdr must appear before all others */ /* This null SHdr must appear before all others */
sh = newElfShdr(elfstr[ElfStrEmpty]); newElfShdr(elfstr[ElfStrEmpty]);
/* program header info */ /* program header info */
pph = newElfPhdr(); pph = newElfPhdr();