From 0cd7d8826ebc37c4f1962fa15a4701ac468dd0ed Mon Sep 17 00:00:00 2001 From: sater Date: Sat, 19 May 1984 11:49:01 +0000 Subject: [PATCH] erase(reg) now also erases all register whose contents depend on the contents of reg. --- mach/proto/cg/reg.c | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/mach/proto/cg/reg.c b/mach/proto/cg/reg.c index 0e10ab8bf..4482dce10 100644 --- a/mach/proto/cg/reg.c +++ b/mach/proto/cg/reg.c @@ -71,21 +71,43 @@ getrefcount(regno) { erasereg(regno) { register struct reginfo *rp; - register i; #if MAXMEMBERS==0 - rp= &machregs[regno]; - rp->r_contents.t_token = 0; - for (i=0;ir_contents.t_att[i].aw=0; + awayreg(regno); #else for (rp=machregs;rpr_clash[regno>>4]&(1<<(regno&017))) { - rp->r_contents.t_token = 0; + 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->r_contents.t_token = 0; + for (i=0;ir_contents.t_att[i].aw = 0; + + /* Now erase recursively all registers containing + * something using this one + */ + for (rp=machregs;rpr_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;ir_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() { -- 2.34.1