Commit 9d441828 authored by yb9976's avatar yb9976
Browse files

- reserve necessary resources before collect phiprojs

- fixed assertion

[r23316]
parent cad8bfd2
......@@ -164,7 +164,7 @@ static void clear_node_and_phis_links(ir_node *n, void *env) {
}
void collect_phiprojs(ir_graph *irg) {
assert(ir_resources_reserved(irg) & (IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST) ==
assert((ir_resources_reserved(irg) & (IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST)) ==
(IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST));
irg_walk_graph(irg, clear_node_and_phis_links, collect_phiprojs_walker, NULL);
}
......
......@@ -2170,6 +2170,7 @@ static void inline_into(ir_graph *irg, unsigned maxsize,
}
if (! phiproj_computed) {
phiproj_computed = 1;
ir_reserve_resources(current_ir_graph, IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST);
collect_phiprojs(current_ir_graph);
}
did_inline = inline_method(call_node, callee);
......@@ -2177,6 +2178,7 @@ static void inline_into(ir_graph *irg, unsigned maxsize,
continue;
/* call was inlined, Phi/Projs for current graph must be recomputed */
ir_free_resources(current_ir_graph, IR_RESOURCE_IRN_LINK|IR_RESOURCE_PHI_LIST);
phiproj_computed = 0;
/* remove it from the caller list */
......
Markdown is supported
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