Set the outs to inconsistent at the end of transform_irg().
[libfirm] / ir / ir / irgopt.c
index 26937a7..52be875 100644 (file)
@@ -412,7 +412,7 @@ static void copy_preds(ir_node *n, void *env) {
                                exchange(nn, old);
                        }
                }
-       } else if (is_Phi(n)) {
+       } else if (is_Phi(n) && get_irn_arity(n) > 0) {
                /* Don't copy node if corresponding predecessor in block is Bad.
                   The Block itself should not be Bad. */
                block = get_nodes_block(n);
@@ -2259,7 +2259,8 @@ static void walk_critical_cf_edges(ir_node *n, void *env) {
                                        goto insert;
                                continue;
                        }
-                       if (is_op_forking(cfop)) {
+                       /* we don't want place nodes in the start block, so handle it like forking */
+                       if (is_op_forking(cfop) || cfop == op_Start) {
                                /* Predecessor has multiple successors. Insert new control flow edge edges. */
 insert:
                                /* set predecessor of new block */