Patchwork Fix crash of debug_bb_n on 0 and 1 in RTL mode

login
register
mail settings
Submitter Eric Botcazou
Date Jan. 20, 2012, 9:35 p.m.
Message ID <201201202235.11170.ebotcazou@adacore.com>
Download mbox | patch
Permalink /patch/137118/
State New
Headers show

Comments

Eric Botcazou - Jan. 20, 2012, 9:35 p.m.
Long overdue, and regression from when ENTRY_BLOCK and EXIT_BLOCK were handled 
differently so applied on mainline/4.6/4.5 branches after testing on x86-linux.


2012-01-20  Eric Botcazou  <ebotcazou@adacore.com>

	* cfgrtl.c (rtl_dump_bb): Do not dump insns for {ENTRY|EXIT}_BLOCK.

Patch

Index: cfgrtl.c
===================================================================
--- cfgrtl.c	(revision 183348)
+++ cfgrtl.c	(working copy)
@@ -1674,9 +1674,10 @@  rtl_dump_bb (basic_block bb, FILE *outf,
       putc ('\n', outf);
     }
 
-  for (insn = BB_HEAD (bb), last = NEXT_INSN (BB_END (bb)); insn != last;
-       insn = NEXT_INSN (insn))
-    print_rtl_single (outf, insn);
+  if (bb->index != ENTRY_BLOCK && bb->index != EXIT_BLOCK)
+    for (insn = BB_HEAD (bb), last = NEXT_INSN (BB_END (bb)); insn != last;
+	 insn = NEXT_INSN (insn))
+      print_rtl_single (outf, insn);
 
   if (df)
     {