------- Comment #2 from steven at gcc dot gnu dot org 2010-01-30 16:42 ------- Even more fun: mark_control_dependent_edges_necessary is called on basic block 6 because a PHI argument is fed to "j_1 = PHI <j_5(D)(2), 0(6)>" i.e. a constant coming from basic block 6:
#1 0x0000000000a16627 in propagate_necessity (el=0x142c5d0) at ../../trunk/gcc/tree-ssa-dce.c:691 691 mark_control_dependent_edges_necessary (arg_bb, el); (gdb) l 686 basic_block arg_bb = gimple_phi_arg_edge (stmt, k)->src; 687 if (arg_bb != ENTRY_BLOCK_PTR 688 && ! TEST_BIT (visited_control_parents, arg_bb->index)) 689 { 690 SET_BIT (visited_control_parents, arg_bb->index); 691 mark_control_dependent_edges_necessary (arg_bb, el); 692 } 693 } 694 } 695 } (gdb) p stmt $28 = (gimple) 0x7ffff5ce0c00 (gdb) p debug_gimple_stmt(stmt) j_1 = PHI <j_4(D)(2), 0(6)> The CD-DCE algorithm is not prepared to deal with this situation. (I have said years ago that I didn't think having constants as PHI arguments was always a helpful thing...) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42906