http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51106
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-01-19 09:43:16 UTC --- Shorter testcase for gcc.c-torture/compile/ : int foo (int x) { asm goto ("" : : "i" (x) : : lab); return 1; lab: return 0; } Yeah, I think delete_insn_and_edges is the right fix here. You might also add into the testsuite: int bar (int x) { asm goto ("" : : "i" (x) : : lab); __builtin_unreachable (); lab: return 0; } (fortunately at this point the bb ending with the asm goto still has a fallthru successor, otherwise purge_dead_edges wouldn't work).