Remove a write-only local variable.
[libfirm] / ir / ana / irmemory.c
index 596ba8e..ebbc6d4 100644 (file)
@@ -98,7 +98,7 @@ static ir_alias_relation check_const(ir_node *cns, int size) {
        tarval *tv_size;
 
        if (size == 0)
-               return classify_tarval(tv) != TV_CLASSIFY_NULL ? no_alias : may_alias;
+               return tarval_is_null(tv) ? may_alias : no_alias;
        tv_size = new_tarval_from_long(size, get_tarval_mode(tv));
        return tarval_cmp(tv_size, tv) & (pn_Cmp_Eq|pn_Cmp_Lt) ? no_alias : may_alias;
 }  /* check_const */
@@ -934,6 +934,11 @@ static void check_initializer(ir_entity *ent) {
        if (get_entity_variability(ent) == variability_uninitialized)
                return;
 
+       /* Beware: Methods initialized with "themself". This does not count as a taken
+          address. */
+       if (is_Method_type(get_entity_type(ent)))
+               return;
+
        if (is_atomic_entity(ent)) {
                /* let's check if it's an address */
                n = get_atomic_ent_value(ent);