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 Biener <rguenth@gcc.gnu.org>2007-11-23 14:28:59 +0000
commit27fa4044f10f2a28e3e33b8b126462276f8fdc4f (patch)
tree48a10a4d1d5afd593e94941b3bf4da1a06912d68 /gcc/alloc-pool.c
parentbdcfbbfccba6c7f843908b7b5d1bef1acd23ccbc (diff)
downloadgcc-27fa4044f10f2a28e3e33b8b126462276f8fdc4f.zip
gcc-27fa4044f10f2a28e3e33b8b126462276f8fdc4f.tar.gz
gcc-27fa4044f10f2a28e3e33b8b126462276f8fdc4f.tar.bz2
re PR tree-optimization/34176 (SCCVN breaks gettext)
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. Co-Authored-By: Michael Matz <matz@suse.de> From-SVN: r130379
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 1b3dc91..d5d1fab 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