This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] bitmap leak low hanging fruits
- From: Dirk Mueller <dmuell at gmx dot net>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 1 Aug 2006 01:50:34 +0200
- Subject: [PATCH] bitmap leak low hanging fruits
Hi,
In two places bitmap's were allocated but never free'd.
2006-08-01 Dirk Mueller <dmueller@suse.de>
* tree-vrp.c (fix_equivalence_set): Avoid bitmap memory leak.
* tree-outof-ssa.c (check_replaceable): Likewise.
--- tree-vrp.c (revision 115775)
+++ tree-vrp.c (working copy)
@@ -760,7 +759,7 @@ fix_equivalence_set (value_range_t *vr_p
bitmap_iterator bi;
unsigned i;
bitmap e = vr_p->equiv;
- bitmap to_remove = BITMAP_ALLOC (NULL);
+ bitmap to_remove;
/* Only detect inconsistencies on numeric ranges. */
if (vr_p->type == VR_VARYING
@@ -768,6 +767,7 @@ fix_equivalence_set (value_range_t *vr_p
|| symbolic_range_p (vr_p))
return;
+ to_remove = BITMAP_ALLOC (NULL);
EXECUTE_IF_SET_IN_BITMAP (e, 0, i, bi)
{
value_range_t *equiv_vr = vr_value[i];
--- tree-outof-ssa.c (revision 115775)
+++ tree-outof-ssa.c (working copy)
@@ -1556,7 +1556,7 @@ check_replaceable (temp_expr_table_p tab
var_map map = tab->map;
ssa_op_iter iter;
tree call_expr;
- bitmap def_vars = BITMAP_ALLOC (NULL), use_vars;
+ bitmap def_vars, use_vars;
if (TREE_CODE (stmt) != MODIFY_EXPR)
return false;
@@ -1586,6 +1586,7 @@ check_replaceable (temp_expr_table_p tab
return false;
}
+ def_vars = BITMAP_ALLOC (NULL);
version = SSA_NAME_VERSION (def);
basevar = SSA_NAME_VAR (def);
bitmap_set_bit (def_vars, DECL_UID (basevar));