From: Julian Seward Date: Wed, 27 Oct 2004 22:56:54 +0000 (+0000) Subject: Fix yet another bug pertaining to muddy thinking on the meaning of X-Git-Tag: svn/VALGRIND_3_0_1^2~896 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=60525c31264cb7947f34b4f7a237367bc119df42;p=thirdparty%2Fvalgrind.git Fix yet another bug pertaining to muddy thinking on the meaning of dead-after numbers. This one was causing the "Post-instruction actions for fixed rreg uses" section to free up rregs emerging from HLRs one insn too late, and causing the sanity-check stuff for the next insn to fail. As a result, also properly fix an assertion in the sanity-check section. git-svn-id: svn://svn.valgrind.org/vex/trunk@438 --- diff --git a/VEX/priv/host-generic/reg_alloc.c b/VEX/priv/host-generic/reg_alloc.c index 0a901164f6..bc86442bd3 100644 --- a/VEX/priv/host-generic/reg_alloc.c +++ b/VEX/priv/host-generic/reg_alloc.c @@ -697,7 +697,7 @@ HInstrArray* doRegisterAllocation ( for (k = 0; k < rreg_info_used; k++) if (rreg_info[k].rreg == state[j].rreg && rreg_info[k].live_after < ii - && ii <= rreg_info[k].dead_before) + && ii < rreg_info[k].dead_before) break; /* If this vassertion fails, we couldn't find a corresponding HLR. */ @@ -1049,7 +1049,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) { + if (rreg_info[j].dead_before == ii+1) { /* 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++)