This is the mail archive of the gcc-bugs@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]

[Bug tree-optimization/54824] [4.8 Regression] ICE in verify_loop_structure


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54824

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> 2012-10-24 13:14:21 UTC ---
For example

Index: cfgexpand.c
===================================================================
--- cfgexpand.c (revision 192760)
+++ cfgexpand.c (working copy)
@@ -4474,7 +4474,17 @@ gimple_expand_cfg (void)

   lab_rtx_for_bb = pointer_map_create ();
   FOR_BB_BETWEEN (bb, init_block->next_bb, EXIT_BLOCK_PTR, next_bb)
-    bb = expand_gimple_basic_block (bb);
+    {
+      /* If we have a basic-block with no successors connect it to itself.
+         This avoids find_many_sub_basic_blocks to connect it randomly
+        to the next block.
+        ???  We can for example end up here when inlining a noreturn
+        function that does in fact return.  Infinite loop is as good
+        as noreturn and better than falling though to a random block.  */
+      if (EDGE_COUNT (bb->succs) == 0)
+       make_edge (bb, bb, EDGE_FALLTHRU);
+      bb = expand_gimple_basic_block (bb);
+    }

   if (MAY_HAVE_DEBUG_INSNS)
     expand_debug_locations ();

"fixes" it.  We can also fix it in fixup_cfg as soon as the situation occurs.
That's what I am testing.


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