summaryrefslogtreecommitdiff
path: root/gcc/alloc-pool.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-23 14:28:59 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-23 14:28:59 +0000
commit48694fc0bcb705daf70c22d5e3d836ee90b0685a (patch)
tree48a10a4d1d5afd593e94941b3bf4da1a06912d68 /gcc/alloc-pool.c
parentd383205a7b5f1873e1a37b64beef9d385543f93c (diff)
downloadgcc-48694fc0bcb705daf70c22d5e3d836ee90b0685a.tar.gz
2007-11-23 Richard Guenther <rguenther@suse.de>
Michael Matz <matz@suse.de> PR tree-optimization/34176 * alloc-pool.h (empty_alloc_pool): Declare. * alloc-pool.c (empty_alloc_pool): New function. * tree-ssa-sccvn.c (vn_reference_lookup): Also lookup from the valid table if a lookup from the optimistic table failed. (vn_unary_op_lookup): Likewise. (vn_binary_op_lookup): Likewise. (vn_phi_lookup): Likewise. (process_scc): Clear optimistic tables before every iteration. * gcc.c-torture/execute/pr34176.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130379 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alloc-pool.c')
-rw-r--r--gcc/alloc-pool.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/alloc-pool.c b/gcc/alloc-pool.c
index 1b3dc915509..d5d1fab79af 100644
--- a/gcc/alloc-pool.c
+++ b/gcc/alloc-pool.c
@@ -183,7 +183,7 @@ create_alloc_pool (const char *name, size_t size, size_t num)
/* Free all memory allocated for the given memory pool. */
void
-free_alloc_pool (alloc_pool pool)
+empty_alloc_pool (alloc_pool pool)
{
alloc_pool_list block, next_block;
#ifdef GATHER_STATISTICS
@@ -201,6 +201,22 @@ free_alloc_pool (alloc_pool pool)
desc->current -= pool->block_size;
#endif
}
+
+ pool->returned_free_list = NULL;
+ pool->virgin_free_list = NULL;
+ pool->virgin_elts_remaining = 0;
+ pool->elts_allocated = 0;
+ pool->elts_free = 0;
+ pool->blocks_allocated = 0;
+ pool->block_list = NULL;
+}
+
+/* Free all memory allocated for the given memory pool and the pool itself. */
+void
+free_alloc_pool (alloc_pool pool)
+{
+ /* First empty the pool. */
+ empty_alloc_pool (pool);
#ifdef ENABLE_CHECKING
memset (pool, 0xaf, sizeof (*pool));
#endif