X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fscalar_replace.c;h=4056172f592ae4a783d6278e9ea39751ef3c37d8;hb=6c7c7c010b4f0c9fc87ba4f740fe60ac93ef5724;hp=5e7a00e95540984ddb2540ed90428ffff57e8c04;hpb=a63ae9728ba0fbe891a2bb6c291c41b0e618af62;p=libfirm diff --git a/ir/opt/scalar_replace.c b/ir/opt/scalar_replace.c index 5e7a00e95..4056172f5 100644 --- a/ir/opt/scalar_replace.c +++ b/ir/opt/scalar_replace.c @@ -211,9 +211,14 @@ int is_address_taken(ir_node *sel) break; case iro_Sel: { - /* Check the Sel successor of Sel */ - int res = is_address_taken(succ); + int res; + ir_entity *entity = get_Sel_entity(succ); + /* we can't handle unions correctly yet -> address taken */ + if (is_Union_type(get_entity_owner(entity))) + return 1; + /* Check the Sel successor of Sel */ + res = is_address_taken(succ); if (res) return 1; break; @@ -682,7 +687,7 @@ int scalar_replacement_opt(ir_graph *irg) { /* Call algorithm that computes the out edges */ assure_irg_outs(irg); - /* we use the link firld to store the VNUM */ + /* we use the link field to store the VNUM */ ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK); irp_reserve_resources(irp, IR_RESOURCE_ENTITY_LINK);