cannot allocate an audomatic temp
while real registers are allocated.
there is a chance that the automatic
will be allocated to one of the
allocated registers. the fix is to
not registerize such variables.
R=rsc
CC=golang-dev
https://golang.org/cl/
1202042
}
}
+int32
+anyregalloc(void)
+{
+ return 0;
+}
+
/*
* allocate register of type t, leave in n.
* if o != N, o is desired fixed register.
uchar index;
uchar etype;
uchar scale; /* doubles as width in DATA op */
+ uchar pun; /* dont register variable */
};
#define A ((Addr*)0)
yyerror("reg %R left allocated\n", i);
}
+int32
+anyregalloc(void)
+{
+ int i, j;
+
+ for(i=D_AL; i<=D_DI; i++) {
+ if(reg[i] == 0)
+ goto ok;
+ for(j=0; j<nelem(resvd); j++)
+ if(resvd[j] == i)
+ goto ok;
+ return 1;
+ ok:;
+ }
+ return 0;
+}
+
/*
* allocate register of type t, leave in n.
* if o != N, o is desired fixed register.
a->width = n->type->width;
a->gotype = ngotype(n);
}
+ a->pun = n->pun;
a->offset = n->xoffset;
a->sym = n->sym;
if(a->sym == S)
}
}
}
+ if(a->pun)
+ flag = 1;
switch(et) {
case 0:
uchar index;
uchar etype;
uchar scale; /* doubles as width in DATA op */
+ uchar pun; /* dont register variable */
};
#define A ((Addr*)0)
yyerror("reg %R left allocated at %lux", i, regpc[i]);
}
+int32
+anyregalloc(void)
+{
+ int i, j;
+
+ for(i=D_AL; i<=D_DI; i++) {
+ if(reg[i] == 0)
+ goto ok;
+ for(j=0; j<nelem(resvd); j++)
+ if(resvd[j] == i)
+ goto ok;
+ return 1;
+ ok:;
+ }
+ return 0;
+}
+
/*
* allocate register of type t, leave in n.
* if o != N, o is desired fixed register.
a->width = n->type->width;
a->gotype = ngotype(n);
}
+ a->pun = n->pun;
a->offset = n->xoffset;
a->sym = n->sym;
if(a->sym == S)
}
}
}
+ if(a->pun)
+ flag = 1;
switch(et) {
case 0:
stksize += w;
stksize = rnd(stksize, w);
n->xoffset = -stksize;
+ n->pun = anyregalloc();
}
uchar used;
uchar oldref;
uchar isddd;
+ uchar pun; // dont registerize variable ONAME
// most nodes
Node* left;
int duintxx(Sym *s, int off, uint64 v, int wid);
void genembedtramp(Type*, Type*, Sym*);
int gen_as_init(Node*);
+int anyregalloc();