This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix crash of debug_bb_n on 0 and 1 in RTL mode


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.


-- 
Eric Botcazou
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)
     {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]