https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92788

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, what happens is that we have a bb like:
<bb 13> [local count: 7102878]:
# __result_2 = PHI <_10(3)>
*this_4(D).D.3185._M_impl.D.3135._M_finish = __result_2;
with EH and normal successor edges.
dom_opt_dom_walker::optimize_stmt decides to remove the stmt (the only one in
the bb):
2160              if (cached_lhs && operand_equal_p (rhs, cached_lhs, 0))
2161                {
2162                  basic_block bb = gimple_bb (stmt);
2163                  unlink_stmt_vdef (stmt);
2164                  if (gsi_remove (si, true))
2165                    {
2166                      bitmap_set_bit (need_eh_cleanup, bb->index);
2167                      if (dump_file && (dump_flags & TDF_DETAILS))
2168                        fprintf (dump_file, "  Flagged to clear EH
edges.\n");
2169                    }
2170                  release_defs (stmt);
2171                  *removed_p = true;
2172                  return retval;
2173                }
but before we perform
780       /* Removal of statements may make some EH edges dead.  Purge
781          such edges from the CFG as needed.  */
782       if (!bitmap_empty_p (need_eh_cleanup))
...
to clean up those EH edges,
774       /* Thread jumps, creating duplicate blocks as needed.  */
775       cfg_altered |= thread_through_all_blocks (may_peel_loop_headers_p);
is called, calls thread_block_1 on the bb 13 and ICE trying to redirect EH edge
on a copy of that BB, because for EH edges we obviously assume there is some
statement that can throw but there are no statements in the bb at all.
Not really sure what can be done here.

Reply via email to