------- Comment #3 from steven at gcc dot gnu dot org 2007-05-08 23:15 ------- This patch would fix it, but it's brute-force and it causes a ~1.5% slowdown. Some form of DCE a little more delicate than this will be necessary to fix this bug, though.
Index: cfgcleanup.c =================================================================== --- cfgcleanup.c (revision 124550) +++ cfgcleanup.c (working copy) @@ -2286,10 +2286,10 @@ cleanup_cfg (int mode) { delete_unreachable_blocks (), changed = true; if (!(mode & CLEANUP_NO_INSN_DEL) - && (mode & CLEANUP_EXPENSIVE) - && !reload_completed) + && (mode & (CLEANUP_EXPENSIVE | CLEANUP_CROSSJUMP))) { - if (!delete_trivially_dead_insns (get_insns (), max_reg_num ())) + gcc_assert (df); + if (! run_fast_dce ()) break; } else @@ -2343,10 +2343,9 @@ static unsigned int rest_of_handle_jump2 (void) { delete_trivially_dead_insns (get_insns (), max_reg_num ()); + delete_unreachable_blocks (); if (dump_file) dump_flow_info (dump_file, dump_flags); - cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0) - | (flag_thread_jumps ? CLEANUP_THREADING : 0)); return 0; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30905