From: Julian Seward Date: Mon, 25 Oct 2004 00:43:36 +0000 (+0000) Subject: Try to further clear up confusion re notation for live range in X-Git-Tag: svn/VALGRIND_3_0_1^2~921 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e2d2c15827f137089cace5729a62492f8788c0b;p=thirdparty%2Fvalgrind.git Try to further clear up confusion re notation for live range in reg-alloc. I think it is much improved. This commit also undoes the bogus fix rev 119. git-svn-id: svn://svn.valgrind.org/vex/trunk@413 --- diff --git a/VEX/priv/host-generic/reg_alloc.c b/VEX/priv/host-generic/reg_alloc.c index 5b6c6f478d..da20a106f8 100644 --- a/VEX/priv/host-generic/reg_alloc.c +++ b/VEX/priv/host-generic/reg_alloc.c @@ -628,8 +628,8 @@ HInstrArray* doRegisterAllocation ( entry in the rreg_info array. */ for (j = 0; j < n_available_real_regs; j++) { vassert(state[j].disp == Free - || state[j].disp == Unavail - || state[j].disp == Bound); + || state[j].disp == Unavail + || state[j].disp == Bound); if (state[j].disp != Unavail) continue; for (k = 0; k < rreg_info_used; k++) @@ -680,7 +680,7 @@ HInstrArray* doRegisterAllocation ( m = hregNumber(vregD); vassert(k >= 0 && k < n_vregs); vassert(m >= 0 && m < n_vregs); - if (vreg_info[k].dead_before != ii) goto cannot_coalesce; + if (vreg_info[k].dead_before != ii + 1) goto cannot_coalesce; if (vreg_info[m].live_after != ii) goto cannot_coalesce; # if DEBUG_REGALLOC vex_printf("COALESCE "); @@ -755,7 +755,7 @@ HInstrArray* doRegisterAllocation ( still live. */ m = hregNumber(state[k].vreg); vassert(m >= 0 && m < n_vregs); - if (vreg_info[m].dead_before >= ii) { + if (vreg_info[m].dead_before > ii) { vassert(vreg_info[m].reg_class != HRcINVALID); EMIT_INSTR( (*genSpill)( state[k].rreg, vreg_info[m].spill_offset ) ); @@ -974,7 +974,7 @@ HInstrArray* doRegisterAllocation ( after this instruction, and if so mark them as free. */ post_insn_actions: for (j = 0; j < rreg_info_used; j++) { - if (rreg_info[j].dead_before == ii+0) { + if (rreg_info[j].dead_before == ii) { /* rreg_info[j].rreg is exiting a hard live range. Mark it as such in the main state array. */ for (k = 0; k < n_state; k++)