Handle if-conversion within endless loops properly by stopping the recursion when...
authorChristoph Mallon <christoph.mallon@gmx.de>
Wed, 16 Mar 2011 14:40:01 +0000 (15:40 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 16 Mar 2011 14:40:01 +0000 (15:40 +0100)
ir/opt/ifconv.c

index 714d4cf..b5c453e 100644 (file)
@@ -261,7 +261,7 @@ static void prepare_path(ir_node* block, int i, const ir_node* dependency)
        for (j = 0; j < pred_arity; ++j) {
                ir_node* pred_pred = get_nodes_block(get_irn_n(pred, j));
 
-               if (is_cdep_on(pred_pred, dependency)) {
+               if (pred_pred != dependency && is_cdep_on(pred_pred, dependency)) {
                        prepare_path(pred, j, dependency);
                        split_block(block, i, j);
                        break;
@@ -294,8 +294,6 @@ restart:
                        ir_node* cond;
                        int j;
 
-                       if (dependency == block) continue;
-
                        if (projx0 == NULL) continue;
 
                        cond = get_Proj_pred(projx0);