]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix yet another bug pertaining to muddy thinking on the meaning of
authorJulian Seward <jseward@acm.org>
Wed, 27 Oct 2004 22:56:54 +0000 (22:56 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 27 Oct 2004 22:56:54 +0000 (22:56 +0000)
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

VEX/priv/host-generic/reg_alloc.c

index 0a901164f69dc8b5b3ad2c340c89b58f0257140e..bc86442bd3dc249b333a9fd39d5c528978c0b711 100644 (file)
@@ -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++)