]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix bug in allocation of vregs for 64-bit IRTemps.
authorJulian Seward <jseward@acm.org>
Wed, 28 Jul 2004 07:12:30 +0000 (07:12 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 28 Jul 2004 07:12:30 +0000 (07:12 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@148

VEX/priv/host-generic/reg_alloc.c
VEX/priv/host-x86/isel.c

index 903f876487f8f7e27e55c312aeb3e2ef9e8b70bb..30158a08b100a2b3511205d29b5781aeceaeb1e6 100644 (file)
@@ -320,8 +320,13 @@ HInstrArray* doRegisterAllocation (
          if (!hregIsVirtual(vreg))
             continue;
          k = hregNumber(vreg);
-         if (k < 0 || k >= n_vregs)
+         if (k < 0 || k >= n_vregs) {
+            vex_printf("\n");
+            (*ppInstr)(instrs_in->arr[ii]);
+            vex_printf("\n");
+            vex_printf("vreg %d, n_vregs %d\n", k, n_vregs);
             vpanic("doRegisterAllocation: out-of-range vreg");
+         }
 
          /* Take the opportunity to note its regclass.  We'll need
             that when allocating spill slots. */
index fe904f8144f7664645013cb00d303c7539727cd8..50e7796dbf57c567718f4330fb544a0df402159f 100644 (file)
@@ -1022,7 +1022,7 @@ HInstrArray* iselBB_X86 ( IRBB* bb, Addr64(*find_helper)(Char*) )
       env->vregmap[i]   = hreg;
       env->vregmapHI[i] = hregHI;
    }
-   env->vreg_ctr = env->n_vregmap;
+   env->vreg_ctr = j;
 
    /* Ok, finally we can iterate over the statements. */
    for (stmt = bb->stmts; stmt; stmt=stmt->link)