Commit 9e504cda by Jan Hubicka Committed by Jan Hubicka

* tree-ssa-pre.c (phi_translate_1): Fix memory leak

From-SVN: r140283
parent a97a7ae9
2008-09-11 Jan Hubicka <jh@suse.cz>
* tree-ssa-pre.c (phi_translate_1): Fix memory leak
2008-09-11 Jan Hubicka <jh@suse.cz>
* tree-ssa.c (redirect_edge_var_map_clear): Fix formatting.
(free_var_map_entry): New function.
(redirect_edge_var_map_destroy): Use it.
......
......@@ -1579,7 +1579,10 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
VEC_free (vn_reference_op_s, heap, newoperands);
if (result && is_gimple_min_invariant (result))
return get_or_alloc_expr_for_constant (result);
{
gcc_assert (!newoperands);
return get_or_alloc_expr_for_constant (result);
}
expr = (pre_expr) pool_alloc (pre_expr_pool);
expr->kind = REFERENCE;
......@@ -1599,11 +1602,13 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
newref = vn_reference_insert_pieces (newvuses,
newoperands,
result, new_val_id);
newoperands = NULL;
PRE_EXPR_REFERENCE (expr) = newref;
get_or_alloc_expression_id (expr);
}
add_to_value (new_val_id, expr);
}
VEC_free (vn_reference_op_s, heap, newoperands);
phi_trans_add (oldexpr, expr, pred);
return expr;
}
......
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