On Tue, Jan 27, 2015 at 09:25:32AM +0100, Eric Botcazou wrote: > > Yes, they do, that is why it crashed during final. > > OK. Why wouldn't it work to call reorder_insns instead of reorder_insns_nobb?
Because reorder_insns doesn't handle the case of moving a barrier into a middle of basic block. if (!BARRIER_P (from) && (bb2 = BLOCK_FOR_INSN (from))) { if (BB_END (bb2) == to) BB_END (bb2) = prev; df_set_bb_dirty (bb2); } if (BB_END (bb) == after) BB_END (bb) = to; for (x = from; x != NEXT_INSN (to); x = NEXT_INSN (x)) if (!BARRIER_P (x)) df_insn_change_bb (x, bb); from == to is a BARRIER in this case, BB_END (bb) != after (BB_END is actually PREV_INSN (from)), so this doesn't do anything at all. While what we need is: 1) set BB_END to after 2) clear BLOCK_FOR_INSN on the notes after AFTER (after addition of barrier after FROM == TO) until former PREV_INSN (FROM) (inclusive) Jakub