On 09/18/2015 05:36 PM, Segher Boessenkool wrote:
{ + while (pro != entry && !can_get_prologue (pro, prologue_clobbered)) + { + gcc_assert (pro != entry);
Lose the assert, it's redundant with the loop condition.
+ basic_block new_bb = create_empty_bb (EXIT_BLOCK_PTR_FOR_FN (cfun)->prev_bb); + BB_COPY_PARTITION (new_bb, pro);
[...]
+ *entry_edge = make_single_succ_edge (new_bb, pro, EDGE_FALLTHRU); + force_nonfallthru (*entry_edge); + free_dominance_info (CDI_DOMINATORS); }
Not sure I like creating a fallthru edge and then calling force_nonfallthru on it. Have a look at emit_to_new_bb_before in except.c which does something similar - it creates the new block before the one into which it wants to fall thru, and modifies a potential existing fallthru edge. I'd like that better; please change the patch if you also agree. Otherwise ok.
Bernd