X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firopt.c;h=dcbe3baec97dc1f3a70cc1cec51775c1a04d78af;hb=637542932dc27dcdfc7def09b58d9d5d4c34fb77;hp=1184f29ffac4e4b5cdaa68f4f8d943c2c6ad59e5;hpb=4b7dd9b7c4190578655b4049c836eb996c18528d;p=libfirm diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index 1184f29ff..dcbe3baec 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -961,7 +961,7 @@ static ir_node *equivalent_node_Conv(ir_node *n) /** * A Cast may be removed if the type of the previous node - * is already to type of the Cast. + * is already the type of the Cast. */ static ir_node *equivalent_node_Cast(ir_node *n) { ir_node *pred = get_Cast_op(n); @@ -1648,7 +1648,7 @@ static ir_node *transform_node_Not(ir_node *n) static ir_node *transform_node_Cast(ir_node *n) { ir_node *oldn = n; ir_node *pred = get_Cast_op(n); - type *tp = get_irn_type(pred); + type *tp = get_irn_type(n); if (get_irn_op(pred) == op_Const && get_Const_type(pred) != tp) { n = new_rd_Const_type(NULL, current_ir_graph, get_nodes_block(pred), get_irn_mode(pred), @@ -1659,6 +1659,7 @@ static ir_node *transform_node_Cast(ir_node *n) { get_SymConst_kind(pred), tp); DBG_OPT_CSTEVAL(oldn, n); } + return n; } @@ -1877,7 +1878,7 @@ static ir_node *transform_node_Proj(ir_node *proj) } } - if (tv != tarval_bad) { + if ((tv != tarval_bad) && (proj_nr == pn_Cmp_Eq || proj_nr == pn_Cmp_Lg)) { ir_op *op = get_irn_op(left); /* a-c1 == c2 ==> a == c2+c1, a-c1 != c2 ==> a != c2+c1 */