diff --git a/gcc/global.c b/gcc/global.c index d6a05263..46608b9b 100755 --- a/gcc/global.c +++ b/gcc/global.c @@ -1187,12 +1187,24 @@ find_reg (allocno, losers, alt_regs_p, accept_call_clobbered, retrying) /* Did we find a register? */ + if (best_reg < 0 && getenv ("AGBCC_TRACE_ALLOC")) + fprintf (stderr, "[galloc] pseudo %d -> SPILL (allocno %d, calls_crossed %d)\n", + allocno_reg[allocno], allocno, (int) allocno_calls_crossed[allocno]); + if (best_reg >= 0) { register int lim, j; HARD_REG_SET this_reg; /* Yes. Record it as the hard register of this pseudo-reg. */ + if (getenv ("AGBCC_TRACE_ALLOC")) + fprintf (stderr, + "[galloc] pseudo %d -> r%d (allocno %d, size %d, calls_crossed %d, live_length %d, n_refs %d)\n", + allocno_reg[allocno], best_reg, allocno, + (int) allocno_size[allocno], + (int) allocno_calls_crossed[allocno], + (int) allocno_live_length[allocno], + (int) allocno_n_refs[allocno]); reg_renumber[allocno_reg[allocno]] = best_reg; /* Also of any pseudo-regs that share with it. */ if (reg_may_share[allocno_reg[allocno]]) diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index d4b45f01..6bfe23b7 100755 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -1412,7 +1412,15 @@ block_alloc (b) if (qty_phys_reg[q] >= 0) { for (i = qty_first_reg[q]; i >= 0; i = reg_next_in_qty[i]) - reg_renumber[i] = qty_phys_reg[q] + reg_offset[i]; + { + if (getenv ("AGBCC_TRACE_ALLOC")) + fprintf (stderr, + "[lalloc] pseudo %d -> r%d (qty %d, births %d, deaths %d, n_calls_crossed %d)\n", + i, qty_phys_reg[q] + reg_offset[i], q, + (int) qty_birth[q], (int) qty_death[q], + (int) qty_n_calls_crossed[q]); + reg_renumber[i] = qty_phys_reg[q] + reg_offset[i]; + } } }