On 09/21/2015 04:01 PM, Segher Boessenkool wrote:
On Mon, Sep 21, 2015 at 01:56:28PM +0200, Bernd Schmidt wrote:
+ 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.
It's just to create the edge and a branch, and to set all flags and the
edge probability etc. correctly for it. (You have to first make it
EDGE_FALLTHRU or force_nonfallthru will complain). Is there a nicer
idiom, or a helper function? Should there be?
I tried to come up with something better and failed. So, given that your
solution seems to work, the patch is ok.
Bernd