cleanup
[libfirm] / ir / opt / ldstopt.c
index 156293d..0416d5a 100644 (file)
@@ -1096,8 +1096,9 @@ ir_node *can_replace_load_by_const(const ir_node *load, ir_node *c)
                if (is_reinterpret_cast(c_mode, l_mode)) {
                        /* copy the value from the const code irg and cast it */
                        res = new_rd_Conv(dbgi, block, res, l_mode);
+               } else {
+                       return NULL;
                }
-               return NULL;
        }
        return res;
 }
@@ -1167,7 +1168,7 @@ static unsigned optimize_load(ir_node *load)
                        }
 
                        if (get_entity_linkage(ent) & IR_LINKAGE_CONSTANT) {
-                               if (ent->initializer != NULL) {
+                               if (has_entity_initializer(ent)) {
                                        /* new style initializer */
                                        value = find_compound_ent_value(ptr);
                                } else if (entity_has_compound_ent_values(ent)) {