b = new_node;
new_node = equivalent_node(b);
}
- /* GL @@@ get_opt_normalize hinzugefuegt, 5.5.2003 */
if (is_Bad(new_node) && get_opt_normalize()) exchange(n, new_Bad());
}
}
/* Collect Phi nodes to compact ins along with block's ins. */
set_irn_link(n, get_irn_link(b));
set_irn_link(b, n);
- } else if (get_irn_op(n) != op_Jmp) { /* Check for non empty block. */
+ } else if ((get_irn_op(n) != op_Jmp) && !is_Bad(b)) { /* Check for non empty block. */
mark_Block_block_visited(b);
}
}
This should be true, as the block is matured before optimize is called.
But what about Phi-cycles with the Phi0/Id that could not be resolved?
Remaining Phi nodes are just Ids. */
- if ((get_Block_n_cfgpreds(n) == 1) &&
- (get_irn_op(get_Block_cfgpred(n, 0)) == op_Jmp) &&
- (get_opt_control_flow_straightening())) {
- n = get_nodes_Block(get_Block_cfgpred(n, 0));
- if (n == oldn) {
- /* Jmp jumps into the block it is in -- deal self cycle. */
+ if (get_Block_n_cfgpreds(n) == 1) {
+ ir_node *cfgpred = skip_Proj(get_Block_cfgpred(n, 0));
+ ir_node *predblock = get_nodes_Block(cfgpred);
+ if (get_irn_op(cfgpred) == op_Jmp) {
+ if (predblock == oldn) {
+ /* Jmp jumps into the block it is in -- deal self cycle. */
+ n = new_Bad(); DBG_OPT_DEAD;
+ } else if (get_opt_control_flow_straightening()) {
+ n = predblock; DBG_OPT_STG;
+ }
+ } else if ((get_irn_op(cfgpred) == op_Cond) && (predblock == oldn)) {
+ /* Cond jumps into the block it is in -- deal self cycle. */
n = new_Bad(); DBG_OPT_DEAD;
- } else {
- DBG_OPT_STG;
}
} else if ((get_Block_n_cfgpreds(n) == 2) &&