Some cleanup of cfopt.
[libfirm] / ir / opt / combo.c
index b930563..448d2d6 100644 (file)
@@ -2262,7 +2262,9 @@ static void compute_Cmp(node_t *node)
                   this breaks AND we get from the argument partitions a different
                   result, ensure monotony by fall to bottom.
                   This happens because initially all nodes are in the same partition ... */
-               if (node->type.tv != tv && is_constant_type(node->type))
+               if (node->type.tv == tarval_bottom)
+                       tv = tarval_bottom;
+               else if (node->type.tv != tv && is_constant_type(node->type))
                        tv = tarval_bottom;
                node->type.tv = tv;
        } else {
@@ -3251,7 +3253,9 @@ static void apply_result(ir_node *irn, void *ctx)
                node_t *block = get_irn_node(get_nodes_block(irn));
 
                if (block->type.tv == tarval_unreachable) {
-                       ir_node *bad = get_irg_bad(current_ir_graph);
+                       ir_graph *irg  = get_irn_irg(irn);
+                       ir_mode  *mode = get_irn_mode(node->node);
+                       ir_node  *bad  = new_r_Bad(irg, mode);
 
                        /* here, bad might already have a node, but this can be safely ignored
                           as long as bad has at least ONE valid node */
@@ -3591,10 +3595,8 @@ void combo(ir_graph *irg)
 
        if (env.modified) {
                /* control flow might changed */
-               set_irg_outs_inconsistent(irg);
                set_irg_extblk_inconsistent(irg);
                set_irg_doms_inconsistent(irg);
-               set_irg_loopinfo_inconsistent(irg);
                set_irg_entity_usage_state(irg, ir_entity_usage_not_computed);
        }