aboutsummaryrefslogtreecommitdiff
path: root/gcc/ddg.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ddg.c')
-rw-r--r--gcc/ddg.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/gcc/ddg.c b/gcc/ddg.c
index 9ea98d6..8aaed80 100644
--- a/gcc/ddg.c
+++ b/gcc/ddg.c
@@ -1081,16 +1081,15 @@ free_ddg_all_sccs (ddg_all_sccs_ptr all_sccs)
int
find_nodes_on_paths (sbitmap result, ddg_ptr g, sbitmap from, sbitmap to)
{
- int answer;
int change;
unsigned int u = 0;
int num_nodes = g->num_nodes;
sbitmap_iterator sbi;
- sbitmap workset = sbitmap_alloc (num_nodes);
- sbitmap reachable_from = sbitmap_alloc (num_nodes);
- sbitmap reach_to = sbitmap_alloc (num_nodes);
- sbitmap tmp = sbitmap_alloc (num_nodes);
+ auto_sbitmap workset (num_nodes);
+ auto_sbitmap reachable_from (num_nodes);
+ auto_sbitmap reach_to (num_nodes);
+ auto_sbitmap tmp (num_nodes);
bitmap_copy (reachable_from, from);
bitmap_copy (tmp, from);
@@ -1150,12 +1149,7 @@ find_nodes_on_paths (sbitmap result, ddg_ptr g, sbitmap from, sbitmap to)
}
}
- answer = bitmap_and (result, reachable_from, reach_to);
- sbitmap_free (workset);
- sbitmap_free (reachable_from);
- sbitmap_free (reach_to);
- sbitmap_free (tmp);
- return answer;
+ return bitmap_and (result, reachable_from, reach_to);
}
@@ -1195,10 +1189,9 @@ longest_simple_path (struct ddg * g, int src, int dest, sbitmap nodes)
int i;
unsigned int u = 0;
int change = 1;
- int result;
int num_nodes = g->num_nodes;
- sbitmap workset = sbitmap_alloc (num_nodes);
- sbitmap tmp = sbitmap_alloc (num_nodes);
+ auto_sbitmap workset (num_nodes);
+ auto_sbitmap tmp (num_nodes);
/* Data will hold the distance of the longest path found so far from
@@ -1224,10 +1217,7 @@ longest_simple_path (struct ddg * g, int src, int dest, sbitmap nodes)
change |= update_dist_to_successors (u_node, nodes, tmp);
}
}
- result = g->nodes[dest].aux.count;
- sbitmap_free (workset);
- sbitmap_free (tmp);
- return result;
+ return g->nodes[dest].aux.count;
}
#endif /* INSN_SCHEDULING */