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

Andrey Belevantsev <abel at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011.04.07 07:45:54
                 CC|                            |abel at gcc dot gnu.org
         AssignedTo|unassigned at gcc dot       |abel at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #1 from Andrey Belevantsev <abel at gcc dot gnu.org> 2011-04-07 
07:45:54 UTC ---
Confirmed, yet another case when we don't expect a block with zero successors. 
The following fixes the problem.

Btw, --param max-sched-extend-regions-iters=2 is enough to reproduce the bug. 
Zdenek, for most functions you don't want more than two iterations (you can see
the comment in sched-rgn.c:1248, so in your experiments you can limit it to not
more than 5-10.  You actually need a positive value for the region extension
code to fire though.

diff --git a/gcc/sel-sched-ir.h b/gcc/sel-sched-ir.h
index 5516da9..13af1b5 100644
--- a/gcc/sel-sched-ir.h
+++ b/gcc/sel-sched-ir.h
@@ -1119,7 +1119,8 @@ get_all_loop_exits (basic_block bb)
   /* If bb is empty, and we're skipping to loop exits, then
      consider bb as a possible gate to the inner loop now.  */
   while (sel_bb_empty_or_nop_p (bb)
-        && in_current_region_p (bb))
+        && in_current_region_p (bb)
+        && EDGE_COUNT (bb->succs) > 0)
     {
       bb = single_succ (bb);

Reply via email to