------- Comment #10 from steven at gcc dot gnu dot org 2010-01-30 20:32 ------- The safe thing to do, may be to ignore self control dependence, like so:
------------------------------------------------- 8< -------------- Index: tree-ssa-dce.c =================================================================== --- tree-ssa-dce.c (revision 156352) +++ tree-ssa-dce.c (working copy) @@ -390,6 +390,11 @@ gimple stmt; basic_block cd_bb = INDEX_EDGE_PRED_BB (el, edge_number); + /* Ignore control dependence on BB itself. This can happen with loops + but since we are here, we have already made BB necessary. */ + if (cd_bb == bb) + continue; + if (TEST_BIT (last_stmt_necessary, cd_bb->index)) continue; SET_BIT (last_stmt_necessary, cd_bb->index); ------------------------------------------------- 8< -------------- Needs testing, but I can't do that right now. Honza, richi...? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42906