From f9b697bfa12e6916716d10c0c842ff2007dae213 Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Thu, 23 Nov 2000 18:19:18 +0000 Subject: [PATCH] Try to dump some information before aborting. From-SVN: r37699 --- gcc/ChangeLog | 6 ++++++ gcc/flow.c | 38 +++++++++++++++++++++++++++++++++++--- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8263d94cda5..b8eb3705398 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2000-11-23 Bernd Schmidt + + * flow.c (print_rtl_and_abort): New function. + (verify_wide_reg, verify_local_live_at_start): Try to dump more + information before aborting. + 2000-11-23 Alexandre Oliva * emit-rtl.c (gen_lowpart_common): Use word 0 if register mode diff --git a/gcc/flow.c b/gcc/flow.c index 23f3236e0aa..f9a7bfb011d 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -405,6 +405,7 @@ static void mark_used_regs PARAMS ((struct propagate_block_info *, void dump_flow_info PARAMS ((FILE *)); void debug_flow_info PARAMS ((void)); static void dump_edge_info PARAMS ((FILE *, edge, int)); +static void print_rtl_and_abort PARAMS ((void)); static void invalidate_mems_from_autoinc PARAMS ((struct propagate_block_info *, rtx)); @@ -2863,7 +2864,9 @@ verify_wide_reg (regno, head, end) } /* We didn't find the register at all. Something's way screwy. */ - abort (); + if (rtl_dump_file) + fprintf (rtl_dump_file, "Aborting in verify_wide_reg; reg %d\n", regno); + print_rtl_and_abort (); } /* A subroutine of update_life_info. Verify that there are no untoward @@ -2879,7 +2882,17 @@ verify_local_live_at_start (new_live_at_start, bb) /* After reload, there are no pseudos, nor subregs of multi-word registers. The regsets should exactly match. */ if (! REG_SET_EQUAL_P (new_live_at_start, bb->global_live_at_start)) - abort (); + { + if (rtl_dump_file) + { + fprintf (rtl_dump_file, + "live_at_start mismatch in bb %d, aborting\n", + bb->index); + debug_bitmap_file (rtl_dump_file, bb->global_live_at_start); + debug_bitmap_file (rtl_dump_file, new_live_at_start); + } + print_rtl_and_abort (); + } } else { @@ -2892,7 +2905,14 @@ verify_local_live_at_start (new_live_at_start, bb) { /* No registers should die. */ if (REGNO_REG_SET_P (bb->global_live_at_start, i)) - abort (); + { + if (rtl_dump_file) + fprintf (rtl_dump_file, + "Register %d died unexpectedly in block %d\n", i, + bb->index); + print_rtl_and_abort (); + } + /* Verify that the now-live register is wider than word_mode. */ verify_wide_reg (i, bb->head, bb->end); }); @@ -6247,6 +6267,18 @@ print_rtl_with_bb (outf, rtx_first) } } +/* Dump the rtl into the current debugging dump file, then abort. */ +static void +print_rtl_and_abort (void) +{ + if (rtl_dump_file) + { + print_rtl_with_bb (rtl_dump_file, get_insns ()); + fclose (rtl_dump_file); + } + abort (); +} + /* Recompute register set/reference counts immediately prior to register allocation. -- 2.30.2