X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fldstopt.c;h=0416d5ac6ac03a98e140a40bdd92e9ca7953662e;hb=762b472fc81c73cf7a1b0041b8cd286b7206d79d;hp=156293dee344ee9a638a5a31fedbcc577fc3d7fb;hpb=8ccfe04ca59ff56fc32b2323b80cee2a5194694d;p=libfirm diff --git a/ir/opt/ldstopt.c b/ir/opt/ldstopt.c index 156293dee..0416d5ac6 100644 --- a/ir/opt/ldstopt.c +++ b/ir/opt/ldstopt.c @@ -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)) {