http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52756
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |law at gcc dot gnu.org --- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-29 12:42:37 UTC --- DOM jump threading threads the loop latch edge: if (latch->aux) { /* First handle the case latch edge is redirected. */ loop->latch = thread_single_edge (latch); gcc_assert (single_succ (loop->latch) == tgt_bb); loop->header = tgt_bb; /* Thread the remaining edges through the former header. */ thread_block (header, false); but the updated loop->latch, loop->header pair is certainly not the proper one. That's the real bug. Jump threading rotates the loop here but fails to realize that - the new header needs to dominate all of the loops remaining BBs, and determine_bb_domination_status does not verify that (either by design or because it is buggy). The symptom is then caused by cfgcleaup merging latch and header and simple latch creation being confused.