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

From-SVN: r140283
This commit is contained in:
Jan Hubicka 2008-09-11 14:36:53 +02:00 committed by Jan Hubicka
parent a97a7ae98b
commit 9e504cda34
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,7 @@
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.

View File

@ -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;
}