https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81194
--- Comment #12 from Peter Bergner <bergner at gcc dot gnu.org> --- (In reply to Peter Bergner from comment #11) > (In reply to Peter Bergner from comment #10) > > I'm testing the attached patch which fixes the ICE. > > Except this ICEs on the following simple test case. I'll see if this is due > to a simple oversite or ... [snip] > It seems cleanup_tree_cfg() has removed the entire function at this point. So with no function body, build_gimple_cfg() calls make_edges() and it contains an assumption that there will be a block in the function with this code: /* Create an edge from entry to the first block with executable statements in it. */ make_edge (ENTRY_BLOCK_PTR_FOR_FN (cfun), BASIC_BLOCK_FOR_FN (cfun, NUM_FIXED_BLOCKS), EDGE_FALLTHRU); but in this case, there is no block numbered NUM_FIXED_BLOCKS which causes find_edge to ICE.