http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49007
--- Comment #10 from John David Anglin <danglin at gcc dot gnu.org> 2011-05-21 22:47:34 UTC --- This PR seems similar to PR rtl-optimization/40710. It seems opposite_needed is incorrectly calculated after the first delay slot iteration in fill_slots_from_thread: mark_target_live_regs (get_insns (), opposite_thread, &opposite_needed); Breakpoint 22, fill_slots_from_thread (insn=0x1b98f30, condition=0x1b99fa0, thread=0x1b981e0, opposite_thread=0x1b98f90, likely=0, thread_if_true=1, own_thread=0, slots_to_fill=1, pslots_filled=0xbfffee4c, delay_list=0x0) at ../../gcc/gcc/reorg.c:2600 2600 new_thread = thread = try_split (PATTERN (thread), thread, 0); (gdb) p/x opposite_needed $69 = { memory = 0x1, unch_memory = 0x0, volatil = 0x0, cc = 0x0, regs = {0x440000e8, 0x0, 0x0} } Register %r4 is no longer marked as alive, so (gdb) p debug_rtx (thread) (insn 107 106 438 ../../gcc/gcc/tree-cfgcleanup.c:695 (set (reg/v:SI 4 %r4 [orig:111 i ] [111]) (plus:SI (reg/v:SI 4 %r4 [orig:111 i ] [111]) (const_int 1 [0x1]))) 111 {addsi3} (nil)) is moved from the branch target.