X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fopt_confirms.c;h=ee23ee53a01a1de0c3824fa136bcd20b87e8a146;hb=f274dcf35aa0d3f4748387dbddfe50e8d7d44951;hp=5a481e23e4c29d478259e58f25ed6e2c5252e969;hpb=829a66832c7e10daa5dc4cf2bbbb726176f787e7;p=libfirm diff --git a/ir/opt/opt_confirms.c b/ir/opt/opt_confirms.c index 5a481e23e..ee23ee53a 100644 --- a/ir/opt/opt_confirms.c +++ b/ir/opt/opt_confirms.c @@ -147,6 +147,7 @@ int value_not_zero(ir_node *n) /* * Check, if the value of a node cannot represent a NULL pointer. * + * - Casts are skipped * - If sel_based_null_check_elim is enabled, all * Sel nodes can be skipped. * - A SymConst(entity) is NEVER a NULL pointer @@ -154,13 +155,15 @@ int value_not_zero(ir_node *n) */ int value_not_null(ir_node *n) { - ir_op *op = get_irn_op(n); + ir_op *op; + n = skip_Cast(n); + op = get_irn_op(n); assert(mode_is_reference(get_irn_mode(n))); if (get_opt_sel_based_null_check_elim()) { - /* skip all Sel nodes */ + /* skip all Sel nodes and Cast's */ while (op == op_Sel) { - n = get_Sel_ptr(n); + n = skip_Cast(get_Sel_ptr(n)); op = get_irn_op(n); } }