X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firopt.c;h=c2cecb135541755428bf95090f081897abbfa566;hb=c25b0f5781313f72027722783ce6286978bdd757;hp=f6367d04a4b7b5d1412a913174f9d6220a20201e;hpb=d1d5979d9967004773067d0e170eacdac48715a8;p=libfirm diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index f6367d04a..c2cecb135 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -722,10 +722,16 @@ static ir_op_ops *firm_set_default_computed_value(ir_opcode code, ir_op_ops *ops static ir_node *equivalent_node_Block(ir_node *n) { ir_node *oldn = n; - int n_preds = get_Block_n_cfgpreds(n); + int n_preds; - /* The Block constructor does not call optimize, but mature_immBlock - calls the optimization. */ + /* don't optimize dead blocks */ + if (is_Block_dead(n)) + return n; + + n_preds = get_Block_n_cfgpreds(n); + + /* The Block constructor does not call optimize, but mature_immBlock() + calls the optimization. */ assert(get_Block_matured(n)); /* Straightening: a single entry Block following a single exit Block @@ -3647,11 +3653,9 @@ static ir_node *transform_node_Proj_Cmp(ir_node *proj) { break; } - /* remove Casts */ - if (is_Cast(left)) - left = get_Cast_op(left); - if (is_Cast(right)) - right = get_Cast_op(right); + /* remove Casts of both sides */ + left = skip_Cast(left); + right = skip_Cast(right); /* Remove unnecessary conversions */ /* TODO handle constants */ @@ -3686,7 +3690,7 @@ static ir_node *transform_node_Proj_Cmp(ir_node *proj) { } } - /* remove operation of both sides if possible */ + /* remove operation on both sides if possible */ if (proj_nr == pn_Cmp_Eq || proj_nr == pn_Cmp_Lg) { /* * The following operations are NOT safe for floating point operations, for instance @@ -5018,7 +5022,7 @@ static int node_cmp_attr_Free(ir_node *a, ir_node *b) { static int node_cmp_attr_SymConst(ir_node *a, ir_node *b) { const symconst_attr *pa = get_irn_symconst_attr(a); const symconst_attr *pb = get_irn_symconst_attr(b); - return (pa->num != pb->num) + return (pa->kind != pb->kind) || (pa->sym.type_p != pb->sym.type_p) || (pa->tp != pb->tp); } /* node_cmp_attr_SymConst */