On 10/05/2015 03:02 AM, Richard Biener wrote:
+ /* If BB is in a loop, then removing an outgoing edge from BB
+ may cause BB to move outside the loop, changes in the
+ loop exit edges, etc. So note that loops need fixing. */
+ if (bb_loop_depth (bb) > 0)
+ loops_state_set (LOOPS_NEED_FIXUP);
+
I would rather do this in remove_ctrl_stmt_and_useless_edges and only
if taken_edge is a loop exit. loop fixup is a pretty big hammer which
we should avoid at all cost.
remove_ctrl_stmt_and_useless_edges is used internally when duplicating
blocks for jump threading, so we'd need to audit for that case as well.
So please try to be more specific on the cases you invoke it.
I'd pondered this and was still working through whether or not
triggering only when one of the outgoing edges was "interesting" from a
loop structure standpoint. I hadn't tested that yet and wanted to get
the regression resolved, hence the large hammer.
jeff