aboutsummaryrefslogtreecommitdiff
path: root/gcc/alloc-pool.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2007-11-23 14:28:59 +0000
committerRichard Guenther <rguenther@suse.de>2007-11-23 14:28:59 +0000
commit23e62d2e6cbc8590fb59d3be6e925548db54ccda (patch)
tree48a10a4d1d5afd593e94941b3bf4da1a06912d68 /gcc/alloc-pool.c
parentf1c0bb2864e40c4645a054352d7e5d38a05fc7db (diff)
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: https://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