aboutsummaryrefslogtreecommitdiff
path: root/gcc/alloc-pool.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-06-13 16:50:26 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-06-13 14:50:26 +0000
commit7a40b8b1219358fed159dbfe516ad795252f062c (patch)
treeaa39f92fe9688daf10109d15793c2c6e0bf4814a /gcc/alloc-pool.c
parent0f398cb4885e76e6f43310eaf9765d7f6b87e9ea (diff)
downloadgcc-7a40b8b1219358fed159dbfe516ad795252f062c.zip
gcc-7a40b8b1219358fed159dbfe516ad795252f062c.tar.gz
gcc-7a40b8b1219358fed159dbfe516ad795252f062c.tar.bz2
bitmap.c (bitmap_and, [...]): Turn internal datastructure checks into checking asserts.
* bitmap.c (bitmap_and, bitmap_and_into, bitmap_and_compl, bitmap_and_compl_into, bitmap_compl_and_into, bitmap_ior, bitmap_ior_into, bitmap_xor, bitmap_xor_into, bitmap_ior_and_compl, bitmap_ior_and_compl): Turn internal datastructure checks into checking asserts. * rtlanal.c (find_reg_note): Use gcc_checking_assert. * tree-ssa-sccvn.c (VN_INFO): Likewise. * df-scan.c (df_reorganize_refs_by_reg_by_reg, df_install_ref, df_ref_create_structure): Likewise. * alloc-pool.c (create_alloc_pool, empty_alloc_pool, pool_alloc, pool_free): Use gcc_checking_assert. * alias.c (get_alias_set): Likewise. * var-tracking.c (variable_htab_free, shared_hash_copy, canonicalize_values_mark, variable_merge_over_cur): Likewise. * lto-streamer.c (bp_unpack_value): Likewise. From-SVN: r160681
Diffstat (limited to 'gcc/alloc-pool.c')
-rw-r--r--gcc/alloc-pool.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/alloc-pool.c b/gcc/alloc-pool.c
index 6eecef5..ade1753 100644
--- a/gcc/alloc-pool.c
+++ b/gcc/alloc-pool.c
@@ -137,7 +137,7 @@ create_alloc_pool (const char *name, size_t size, size_t num)
struct alloc_pool_descriptor *desc;
#endif
- gcc_assert (name);
+ gcc_checking_assert (name);
/* Make size large enough to store the list header. */
if (size < sizeof (alloc_pool_list))
@@ -152,7 +152,7 @@ create_alloc_pool (const char *name, size_t size, size_t num)
#endif
/* Um, we can't really allocate 0 elements per block. */
- gcc_assert (num);
+ gcc_checking_assert (num);
/* Allocate memory for the pool structure. */
pool = XNEW (struct alloc_pool_def);
@@ -201,7 +201,7 @@ empty_alloc_pool (alloc_pool pool)
struct alloc_pool_descriptor *desc = alloc_pool_descriptor (pool->name);
#endif
- gcc_assert (pool);
+ gcc_checking_assert (pool);
/* Free each block allocated to the pool. */
for (block = pool->block_list; block != NULL; block = next_block)
@@ -260,7 +260,7 @@ pool_alloc (alloc_pool pool)
desc->peak = desc->current;
#endif
- gcc_assert (pool);
+ gcc_checking_assert (pool);
/* If there are no more free elements, make some more!. */
if (!pool->returned_free_list)
@@ -328,19 +328,19 @@ pool_free (alloc_pool pool, void *ptr)
struct alloc_pool_descriptor *desc = alloc_pool_descriptor (pool->name);
#endif
- gcc_assert (ptr);
#ifdef ENABLE_CHECKING
- /* Check whether the PTR was allocated from POOL. */
- gcc_assert (pool->id == ALLOCATION_OBJECT_PTR_FROM_USER_PTR (ptr)->id);
+ gcc_assert (ptr
+ /* Check if we free more than we allocated, which is Bad (TM). */
+ && pool->elts_free < pool->elts_allocated
+ /* Check whether the PTR was allocated from POOL. */
+ && pool->id == ALLOCATION_OBJECT_PTR_FROM_USER_PTR (ptr)->id);
memset (ptr, 0xaf, pool->elt_size - offsetof (allocation_object, u.data));
/* Mark the element to be free. */
ALLOCATION_OBJECT_PTR_FROM_USER_PTR (ptr)->id = 0;
#else
- /* Check if we free more than we allocated, which is Bad (TM). */
- gcc_assert (pool->elts_free < pool->elts_allocated);
#endif
header = (alloc_pool_list) ptr;