]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Print useful diagnostics if reg-alloc bombs due to bogus live ranges
authorJulian Seward <jseward@acm.org>
Wed, 9 Feb 2005 19:13:29 +0000 (19:13 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 9 Feb 2005 19:13:29 +0000 (19:13 +0000)
in the input code.

git-svn-id: svn://svn.valgrind.org/vex/trunk@877

VEX/priv/host-generic/reg_alloc2.c

index 7e98067fcfeedee63ffc562e0d09d627c7163174..ecc82551fed5942a9af4a923a5602e1e138182c1 100644 (file)
@@ -492,15 +492,29 @@ HInstrArray* doRegisterAllocation (
                rreg_dead_before[k] = ii+1;
                break;
             case HRmRead:
-               if (rreg_live_after[k] == INVALID_INSTRNO)
+               if (rreg_live_after[k] == INVALID_INSTRNO) {
+                  vex_printf("\nOFFENDING RREG = ");
+                  (*ppReg)(available_real_regs[k]);
+                  vex_printf("\n");
+                  vex_printf("\nOFFENDING instr = ");
+                  (*ppInstr)(instrs_in->arr[ii]);
+                  vex_printf("\n");
                   vpanic("doRegisterAllocation: "
                          "first event for rreg is Read");
+               }
                rreg_dead_before[k] = ii+1;
                break;
             case HRmModify:
-               if (rreg_live_after[k] == INVALID_INSTRNO)
+               if (rreg_live_after[k] == INVALID_INSTRNO) {
+                  vex_printf("\nOFFENDING RREG = ");
+                  (*ppReg)(available_real_regs[k]);
+                  vex_printf("\n");
+                  vex_printf("\nOFFENDING instr = ");
+                  (*ppInstr)(instrs_in->arr[ii]);
+                  vex_printf("\n");
                   vpanic("doRegisterAllocation: "
                          "first event for rreg is Modify");
+               }
                rreg_dead_before[k] = ii+1;
                break;
             default: