I had messed up the check in
r16-5258-g1d8e2d51e5c5cb for preheaders
where return to remvoe the forwarder preheader block even if LOOPS_HAVE_PREHEADERS
was set. I am not sure how often this happens because most of the time the pre-header
will have an incoming phi block anyways but it is safer not to remove it in this case.
Bootstrapped and tested on x86_64-linux-gnu.
gcc/ChangeLog:
* tree-cfgcleanup.cc (tree_forwarder_block_p): Restore check on
LOOPS_HAVE_PREHEADERS.
Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
}
/* cleanup_tree_cfg_noloop just created the loop preheader, don't
remove it if it has phis. */
- else if (bb->loop_father == loop_outer (dest->loop_father))
- return gimple_seq_empty_p (phi_nodes (bb));
- /* Always preserve other edges into loop headers that are
- not simple latches or preheaders. */
- return false;
+ else if (bb->loop_father == loop_outer (dest->loop_father)
+ && gimple_seq_empty_p (phi_nodes (bb))
+ && !loops_state_satisfies_p (LOOPS_HAVE_PREHEADERS))
+ ;
+ else
+ /* Always preserve other edges into loop headers that are
+ not simple latches or preheaders. */
+ return false;
}
}