X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbessaconstr.c;h=bf5ae96dd38038d0f97fb8546e749dae052d349a;hb=5efe7ce7c1754fb95defcc569412b2498fcfe436;hp=26d84ad84d63476fe0e5f900ed6478a3b38a3f3e;hpb=e30e5834fd8c1c3a7d28fc66e99b91a84993bde8;p=libfirm diff --git a/ir/be/bessaconstr.c b/ir/be/bessaconstr.c index 26d84ad84..bf5ae96dd 100644 --- a/ir/be/bessaconstr.c +++ b/ir/be/bessaconstr.c @@ -46,9 +46,10 @@ * This function reroutes all uses of the original value to the copies in the * corresponding dominance subtrees and creates Phi functions where necessary. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif + +/* statev in this file is extensive, so only enable if needed */ +#define DISABLE_STATEV #include "bessaconstr.h" #include "bemodule.h" @@ -115,8 +116,8 @@ ir_node *create_phi(be_ssa_construction_env_t *env, ir_node *block, { int i, n_preds = get_Block_n_cfgpreds(block); ir_graph *irg = get_irn_irg(block); - ir_node *phi; - ir_node **ins = alloca(n_preds * sizeof(ins[0])); + ir_node **ins = ALLOCAN(ir_node*, n_preds); + ir_node *phi; assert(n_preds > 1); @@ -219,7 +220,7 @@ ir_node *search_def(be_ssa_construction_env_t *env, ir_node *at) static void introduce_def_at_block(ir_node *block, ir_node *def) { - if(irn_visited(block)) { + if (irn_visited_else_mark(block)) { ir_node *node = block; ir_node *current_def; @@ -241,7 +242,6 @@ void introduce_def_at_block(ir_node *block, ir_node *def) } else { set_irn_link(block, def); set_irn_link(def, NULL); - mark_irn_visited(block); } } @@ -347,9 +347,9 @@ ir_node **be_ssa_construction_get_new_phis(be_ssa_construction_env_t *env) void be_ssa_construction_fix_users_array(be_ssa_construction_env_t *env, ir_node **nodes, size_t nodes_len) { - stat_ev_cnt_decl(uses); const ir_edge_t *edge, *next; size_t i; + stat_ev_cnt_decl(uses); BE_TIMER_PUSH(t_ssa_constr); @@ -386,7 +386,7 @@ void be_ssa_construction_fix_users_array(be_ssa_construction_env_t *env, def = search_def(env, at); if(def == NULL) { - panic("no definition found for %+F at position %d\n", use, pos); + panic("no definition found for %+F at position %d", use, pos); } DBG((dbg, LEVEL_2, "\t%+F(%d) -> %+F\n", use, pos, def));