- 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)); DBG_OPT_STG;
-
- } else if ((get_Block_n_cfgpreds(n) == 2) &&
- (get_opt_control_flow_weak_simplification())) {
+ if ((get_Block_n_cfgpreds(n) == 1) &&
+ (get_irn_op(get_Block_cfgpred(n, 0)) == op_Jmp)) {
+ ir_node *predblock = get_nodes_Block(get_Block_cfgpred(n, 0));
+ 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_Block_n_cfgpreds(n) == 1) &&
+ (get_irn_op(skip_Proj(get_Block_cfgpred(n, 0))) == op_Cond)) {
+ ir_node *predblock = get_nodes_Block(get_Block_cfgpred(n, 0));
+ if (predblock == oldn) {
+ /* Jmp jumps into the block it is in -- deal self cycle. */
+ n = new_Bad(); DBG_OPT_DEAD;
+ }
+ }
+ else if ((get_Block_n_cfgpreds(n) == 2) &&
+ (get_opt_control_flow_weak_simplification())) {