Commit eaf2fbec authored by yb9976's avatar yb9976
Browse files

Load-store optimization: Ensure that address points to constant memory.

parent 0913ee35
...@@ -238,7 +238,9 @@ static ir_entity *find_constant_entity(ir_node *ptr) ...@@ -238,7 +238,9 @@ static ir_entity *find_constant_entity(ir_node *ptr)
{ {
for (;;) { for (;;) {
if (is_Address(ptr)) { if (is_Address(ptr)) {
return get_Address_entity(ptr); ir_entity *ent = get_Address_entity(ptr);
if (get_entity_linkage(ent) & IR_LINKAGE_CONSTANT)
return ent;
} else if (is_Sel(ptr)) { } else if (is_Sel(ptr)) {
ir_entity *ent = get_Sel_entity(ptr); ir_entity *ent = get_Sel_entity(ptr);
ir_type *tp = get_entity_owner(ent); ir_type *tp = get_entity_owner(ent);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment