On Thu, Sep 24, 2015 at 06:03:33PM +0200, Steven Bosscher wrote: > On Thu, Sep 24, 2015 at 12:06 AM, Segher Boessenkool wrote: > > + /* First, collect all edges that can be optimized by reordering blocks: > > + simple jumps and conditional jumps, as well as the function entry > > edge. */ > > + > > + int n = 0; > > + edges[n++] = EDGE_SUCC (ENTRY_BLOCK_PTR_FOR_FN (cfun), 0); > > + > > + basic_block bb; > > + FOR_EACH_BB_FN (bb, cfun) > > + { > > + rtx_insn *end = BB_END (bb); > > + > > + if (computed_jump_p (end) || tablejump_p (end, NULL, NULL)) > > + continue; > > Should handle ASM jumps.
Right, those are considered as optimisable now, although they are not. Will fix. > > + FOR_ALL_BB_FN (bb, cfun) > > + bb->aux = bb; > > Bit tricky for the ENTRY and EXIT blocks, that are not really basic > blocks. After the pass, EXIT should not end up pointing to itself. But it doesn't, the next line already takes care of it. Segher