X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fscalar_replace.c;h=8c87f7780f49fd2438048787fcb88e497954aeed;hb=0cc8bfc863da28d3799e9eca1d1765d564b6e573;hp=b0d76ca8e501a484fae622a79b36457f6d66d694;hpb=dabeb60673b82e56037c95bf3abf104f2389b0b5;p=libfirm diff --git a/ir/opt/scalar_replace.c b/ir/opt/scalar_replace.c index b0d76ca8e..8c87f7780 100644 --- a/ir/opt/scalar_replace.c +++ b/ir/opt/scalar_replace.c @@ -290,7 +290,7 @@ static void link_all_leave_sels(ir_entity *ent, ir_node *sel) { * visited more than once causing a ring here, so we use the * node flag to mark linked nodes */ - if (irn_visited(sel)) + if (irn_visited_else_mark(sel)) return; /* we know we are at a leave, because this function is only @@ -299,8 +299,6 @@ static void link_all_leave_sels(ir_entity *ent, ir_node *sel) { */ set_irn_link(sel, get_entity_link(ent)); set_entity_link(ent, sel); - - mark_irn_visited(sel); } } @@ -406,8 +404,7 @@ static path_t *find_path(ir_node *sel, unsigned len) { if (! is_Sel(pred)) { /* we found the root */ - - res = xmalloc(sizeof(*res) + (len - 1) * sizeof(res->path)); + res = XMALLOCF(path_t, path, len); res->path_len = len; } else res = find_path(pred, len);