------- Comment #6 from jakub at gcc dot gnu dot org  2010-05-11 10:01 -------
Created an attachment (id=20625)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20625&action=view)
partial fix of the ICE

The ICE is when going out of cfglayout mode.
When going into the cfglayout mode try_optimize_cfg deletes the following empty
block with no successors:
1988      /* Delete trivially dead basic blocks.  This is either
1989         blocks with no predecessors, or empty blocks with no
1990         successors.  However if the empty block with no
1991         successors is the successor of the ENTRY_BLOCK, it is
1992         kept.  This ensures that the ENTRY_BLOCK will have a
1993         successor which is a precondition for many RTL
1994         passes.  Empty blocks may result from expanding
1995         __builtin_unreachable ().  */
1996      if (EDGE_COUNT (b->preds) == 0
1997          || (EDGE_COUNT (b->succs) == 0
...

It is fine when asm doesn't have a fallthru edge IMHO because of this, so the
patch just handles that case.  Unfortunately, we ICE with this patch shortly
after during cfg verification once we went out of the cfglayout mode.
The problem is that the empty bb was deleted in cfglayout mode and its
il.footer
(which contained a BARRIER) got dropped on the floor.  I guess if there is a
predecessor and its fallthrough edge goes to the empty bb its il.footer
could be moved over to the predecessor.


-- 


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

Reply via email to