erase(reg) now also erases all register whose contents depend on

the contents of reg.
This commit is contained in:
sater 1984-05-19 11:49:01 +00:00
parent 9dfcd76f4b
commit 0cd7d8826e

View file

@ -71,21 +71,43 @@ getrefcount(regno) {
erasereg(regno) { erasereg(regno) {
register struct reginfo *rp; register struct reginfo *rp;
register i;
#if MAXMEMBERS==0 #if MAXMEMBERS==0
awayreg(regno);
#else
for (rp=machregs;rp<machregs+NREGS;rp++)
if (rp->r_clash[regno>>4]&(1<<(regno&017)))
awayreg(rp-machregs);
#endif
}
awayreg(regno) {
register struct reginfo *rp;
register tkdef_p tdp;
register i;
rp = &machregs[regno]; rp = &machregs[regno];
rp->r_contents.t_token = 0; rp->r_contents.t_token = 0;
for (i=0;i<TOKENSIZE;i++) for (i=0;i<TOKENSIZE;i++)
rp->r_contents.t_att[i].aw = 0; rp->r_contents.t_att[i].aw = 0;
#else
for (rp=machregs;rp<machregs+NREGS;rp++) /* Now erase recursively all registers containing
if (rp->r_clash[regno>>4]&(1<<(regno&017))) { * something using this one
rp->r_contents.t_token = 0; */
for (rp=machregs;rp<machregs+NREGS;rp++) {
if (rp->r_contents.t_token == -1) {
if (rp->r_contents.t_att[0].ar == regno)
erasereg(rp-machregs);
} else {
tdp= & tokens[rp->r_contents.t_token];
for (i=0;i<TOKENSIZE;i++) for (i=0;i<TOKENSIZE;i++)
rp->r_contents.t_att[i].aw=0; if (tdp->t_type[i] == EV_REG &&
rp->r_contents.t_att[i].ar == regno) {
erasereg(rp-machregs);
break;
}
}
} }
#endif
} }
cleanregs() { cleanregs() {