Commit 282899df by Nathan Sidwell

gcse.c (INSN_CUID, [...]): Use gcc_assert and gcc_unreachable.

	* gcse.c (INSN_CUID, insert_set_in_table, find_avail_set,
	cprop_insn, do_local_cprop, local_cprop_pass, find_bypass_set,
	process_insert_insn, insert_insn_end_bb, pre_insert_copy_insn,
	hoist_code, extract_mentioned_regs_helper, compute_store_table,
	insert_store): Use gcc_assert and gcc_unreachable.
	* ggc-common.c (ggc_splay_alloc, ggc_splay_dont_free,
	gt_pch_note_object, gt_pch_note_reorder, relocate_ptrs,
	ggc_record_overhead): Likewise.
	* ggc-page.c (alloc_page, free_page, ggc_set_mark, ggc_marked_p,
	init_ggc, ggc_push_context, ggc_recalculate_in_use_p,
	ggc_pop_context, clear_marks, validate_free_objects,
	ggc_pch_read): Likewise.
	* ggc-zone.c (ggc_allocated_p, free_chunk, ggc_set_mark,
	ggc_marked_p, ggc_get_size, init_ggc, destroy_ggc_zone,
	ggc_push_context, check_cookies, ggc_collect,
	ggc_print_statistics): Likewise.
	* gimple-low.c (lower_function_body, lower_stmt,
	lower_bind_expr): Likewise.
	* gimplify.c (gimple_tree_eq, push_gimplify_context,
	pop_gimplify_context, gimple_pop_condition, create_tmp_var,
	declare_tmp_vars, gimple_add_tmp_var, annotate_all_with_locus,
	mostly_copy_tree_r, gimplify_return_expr, gimplify_switch_expr,
	gimplify_case_label_expr, gimplify_exit_block_expr,
	canonicalize_component_ref, gimplify_compound_lval,
	gimplify_self_mod_expr, gimplify_call_expr,
	gimplify_init_ctor_eval, gimplify_init_constructor,
	gimplify_modify_expr, gimplify_save_expr, gimplify_target_expr,
	gimplify_expr, check_pointer_types_r,
	force_gimple_operand): Likewise.
	* global.c (global_alloc, build_insn_chain): Likewise.
	* graph.c (clean_graph_dump_file,
	finish_graph_dump_file): Likewise.
	gcov-io.c (gcov_open): Use GCOV_CHECK.

From-SVN: r87240
parent 2a88ebca
2004-09-08 Nathan Sidwell <nathan@codesourcery.com>
* gcse.c (INSN_CUID, insert_set_in_table, find_avail_set,
cprop_insn, do_local_cprop, local_cprop_pass, find_bypass_set,
process_insert_insn, insert_insn_end_bb, pre_insert_copy_insn,
hoist_code, extract_mentioned_regs_helper, compute_store_table,
insert_store): Use gcc_assert and gcc_unreachable.
* ggc-common.c (ggc_splay_alloc, ggc_splay_dont_free,
gt_pch_note_object, gt_pch_note_reorder, relocate_ptrs,
ggc_record_overhead): Likewise.
* ggc-page.c (alloc_page, free_page, ggc_set_mark, ggc_marked_p,
init_ggc, ggc_push_context, ggc_recalculate_in_use_p,
ggc_pop_context, clear_marks, validate_free_objects,
ggc_pch_read): Likewise.
* ggc-zone.c (ggc_allocated_p, free_chunk, ggc_set_mark,
ggc_marked_p, ggc_get_size, init_ggc, destroy_ggc_zone,
ggc_push_context, check_cookies, ggc_collect,
ggc_print_statistics): Likewise.
* gimple-low.c (lower_function_body, lower_stmt,
lower_bind_expr): Likewise.
* gimplify.c (gimple_tree_eq, push_gimplify_context,
pop_gimplify_context, gimple_pop_condition, create_tmp_var,
declare_tmp_vars, gimple_add_tmp_var, annotate_all_with_locus,
mostly_copy_tree_r, gimplify_return_expr, gimplify_switch_expr,
gimplify_case_label_expr, gimplify_exit_block_expr,
canonicalize_component_ref, gimplify_compound_lval,
gimplify_self_mod_expr, gimplify_call_expr,
gimplify_init_ctor_eval, gimplify_init_constructor,
gimplify_modify_expr, gimplify_save_expr, gimplify_target_expr,
gimplify_expr, check_pointer_types_r,
force_gimple_operand): Likewise.
* global.c (global_alloc, build_insn_chain): Likewise.
* graph.c (clean_graph_dump_file,
finish_graph_dump_file): Likewise.
gcov-io.c (gcov_open): Use GCOV_CHECK.
2004-09-09 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.c (acc_operand, accg_operand): Use REGNO.
......@@ -5,7 +41,8 @@
2004-09-09 Jan Hubicka <jh@suse.cz>
middle-end/17128
* tree-inline.c (expand_call_inline): Make overactive sanity check happy.
* tree-inline.c (expand_call_inline): Make overactive sanity check
happy.
2004-09-09 Jan Hubicka <jh@suse.cz>
......@@ -6796,7 +6833,7 @@
* config/i386/xmmintrin.h: Include <mm_malloc.h>.
2004-08-03 H.J. Lu <hongjiu.lu@intel.com>
Tanguy Fautrà <tfautre@pandora.be>
Tanguy Fautr <tfautre@pandora.be>
* config/i386/pmm_malloc.h: New file.
......
......@@ -74,8 +74,7 @@ gcov_open (const char *name, int mode)
s_flock.l_pid = getpid ();
#endif
if (gcov_var.file)
abort ();
GCOV_CHECK (!gcov_var.file);
gcov_var.start = 0;
gcov_var.offset = gcov_var.length = 0;
gcov_var.overread = -1u;
......
......@@ -389,7 +389,8 @@ static int max_uid;
/* Get the cuid of an insn. */
#ifdef ENABLE_CHECKING
#define INSN_CUID(INSN) (INSN_UID (INSN) > max_uid ? (abort (), 0) : uid_cuid[INSN_UID (INSN)])
#define INSN_CUID(INSN) \
(gcc_assert (INSN_UID (INSN) <= max_uid), uid_cuid[INSN_UID (INSN)])
#else
#define INSN_CUID(INSN) (uid_cuid[INSN_UID (INSN)])
#endif
......@@ -1644,9 +1645,7 @@ insert_set_in_table (rtx x, rtx insn, struct hash_table *table)
struct expr *cur_expr, *last_expr = NULL;
struct occr *cur_occr, *last_occr = NULL;
if (GET_CODE (x) != SET
|| ! REG_P (SET_DEST (x)))
abort ();
gcc_assert (GET_CODE (x) == SET && REG_P (SET_DEST (x)));
hash = hash_set (REGNO (SET_DEST (x)), table->size);
......@@ -2796,8 +2795,7 @@ find_avail_set (int regno, rtx insn)
if (set == 0)
break;
if (GET_CODE (set->expr) != SET)
abort ();
gcc_assert (GET_CODE (set->expr) == SET);
src = SET_SRC (set->expr);
......@@ -3013,8 +3011,7 @@ cprop_insn (rtx insn, int alter_jumps)
pat = set->expr;
/* ??? We might be able to handle PARALLELs. Later. */
if (GET_CODE (pat) != SET)
abort ();
gcc_assert (GET_CODE (pat) == SET);
src = SET_SRC (pat);
......@@ -3155,8 +3152,11 @@ do_local_cprop (rtx x, rtx insn, int alter_jumps, rtx *libcall_sp)
or fix delete_trivially_dead_insns to preserve the setting insn,
or make it delete the REG_EUAQL note, and fix up all passes that
require the REG_EQUAL note there. */
if (!adjust_libcall_notes (x, newcnst, insn, libcall_sp))
abort ();
bool adjusted;
adjusted = adjust_libcall_notes (x, newcnst, insn, libcall_sp);
gcc_assert (adjusted);
if (gcse_file != NULL)
{
fprintf (gcse_file, "LOCAL CONST-PROP: Replacing reg %d in ",
......@@ -3245,8 +3245,7 @@ local_cprop_pass (int alter_jumps)
if (note)
{
if (libcall_sp == libcall_stack)
abort ();
gcc_assert (libcall_sp != libcall_stack);
*--libcall_sp = XEXP (note, 0);
}
note = find_reg_note (insn, REG_RETVAL, NULL_RTX);
......@@ -3520,8 +3519,7 @@ find_bypass_set (int regno, int bb)
if (set == 0)
break;
if (GET_CODE (set->expr) != SET)
abort ();
gcc_assert (GET_CODE (set->expr) == SET);
src = SET_SRC (set->expr);
if (gcse_constant_p (src))
......@@ -4004,8 +4002,13 @@ process_insert_insn (struct expr *expr)
/* Otherwise, make a new insn to compute this expression and make sure the
insn will be recognized (this also adds any needed CLOBBERs). Copy the
expression to make sure we don't have any sharing issues. */
else if (insn_invalid_p (emit_insn (gen_rtx_SET (VOIDmode, reg, exp))))
abort ();
else
{
rtx insn = emit_insn (gen_rtx_SET (VOIDmode, reg, exp));
gcc_assert (!insn_invalid_p (insn));
}
pat = get_insns ();
end_sequence ();
......@@ -4031,8 +4034,7 @@ insert_insn_end_bb (struct expr *expr, basic_block bb, int pre)
rtx pat, pat_end;
pat = process_insert_insn (expr);
if (pat == NULL_RTX || ! INSN_P (pat))
abort ();
gcc_assert (pat && INSN_P (pat));
pat_end = pat;
while (NEXT_INSN (pat_end) != NULL_RTX)
......@@ -4052,10 +4054,9 @@ insert_insn_end_bb (struct expr *expr, basic_block bb, int pre)
/* It should always be the case that we can put these instructions
anywhere in the basic block with performing PRE optimizations.
Check this. */
if (NONJUMP_INSN_P (insn) && pre
&& !TEST_BIT (antloc[bb->index], expr->bitmap_index)
&& !TEST_BIT (transp[bb->index], expr->bitmap_index))
abort ();
gcc_assert (!NONJUMP_INSN_P (insn) || !pre
|| TEST_BIT (antloc[bb->index], expr->bitmap_index)
|| TEST_BIT (transp[bb->index], expr->bitmap_index));
/* If this is a jump table, then we can't insert stuff here. Since
we know the previous real insn must be the tablejump, we insert
......@@ -4097,10 +4098,9 @@ insert_insn_end_bb (struct expr *expr, basic_block bb, int pre)
anywhere in the basic block with performing PRE optimizations.
Check this. */
if (pre
&& !TEST_BIT (antloc[bb->index], expr->bitmap_index)
&& !TEST_BIT (transp[bb->index], expr->bitmap_index))
abort ();
gcc_assert (!pre
|| TEST_BIT (antloc[bb->index], expr->bitmap_index)
|| TEST_BIT (transp[bb->index], expr->bitmap_index));
/* Since different machines initialize their parameter registers
in different orders, assume nothing. Collect the set of all
......@@ -4257,10 +4257,13 @@ pre_insert_copy_insn (struct expr *expr, rtx insn)
int i;
/* This block matches the logic in hash_scan_insn. */
if (GET_CODE (pat) == SET)
set = pat;
else if (GET_CODE (pat) == PARALLEL)
switch (GET_CODE (pat))
{
case SET:
set = pat;
break;
case PARALLEL:
/* Search through the parallel looking for the set whose
source was the expression that we're interested in. */
set = NULL_RTX;
......@@ -4274,9 +4277,11 @@ pre_insert_copy_insn (struct expr *expr, rtx insn)
break;
}
}
break;
default:
gcc_unreachable ();
}
else
abort ();
if (REG_P (SET_DEST (set)))
{
......@@ -4970,15 +4975,10 @@ hoist_code (void)
while (BLOCK_FOR_INSN (occr->insn) != dominated && occr)
occr = occr->next;
/* Should never happen. */
if (!occr)
abort ();
gcc_assert (occr);
insn = occr->insn;
set = single_set (insn);
if (! set)
abort ();
gcc_assert (set);
/* Create a pseudo-reg to store the result of reaching
expressions into. Get the mode for the new pseudo
......@@ -5556,7 +5556,7 @@ extract_mentioned_regs_helper (rtx x, rtx accum)
case POST_DEC:
case POST_INC:
/* We do not run this function with arguments having side effects. */
abort ();
gcc_unreachable ();
case PC:
case CC0: /*FIXME*/
......@@ -5830,8 +5830,7 @@ compute_store_table (void)
#ifdef ENABLE_CHECKING
/* last_set_in should now be all-zero. */
for (regno = 0; regno < max_gcse_regno; regno++)
if (last_set_in[regno] != 0)
abort ();
gcc_assert (!last_set_in[regno]);
#endif
/* Clear temporary marks. */
......@@ -6204,8 +6203,8 @@ insert_store (struct ls_expr * expr, edge e)
if (!(tmp->flags & EDGE_FAKE))
{
int index = EDGE_INDEX (edge_list, tmp->src, tmp->dest);
if (index == EDGE_INDEX_NO_EDGE)
abort ();
gcc_assert (index != EDGE_INDEX_NO_EDGE);
if (! TEST_BIT (pre_insert_map[index], expr->index))
break;
}
......
......@@ -197,16 +197,14 @@ ggc_calloc (size_t s1, size_t s2)
void *
ggc_splay_alloc (int sz, void *nl)
{
if (nl != NULL)
abort ();
gcc_assert (!nl);
return ggc_alloc (sz);
}
void
ggc_splay_dont_free (void * x ATTRIBUTE_UNUSED, void *nl)
{
if (nl != NULL)
abort ();
gcc_assert (!nl);
}
/* Print statistics that are independent of the collector in use. */
......@@ -266,9 +264,8 @@ gt_pch_note_object (void *obj, void *note_ptr_cookie,
INSERT);
if (*slot != NULL)
{
if ((*slot)->note_ptr_fn != note_ptr_fn
|| (*slot)->note_ptr_cookie != note_ptr_cookie)
abort ();
gcc_assert ((*slot)->note_ptr_fn == note_ptr_fn
&& (*slot)->note_ptr_cookie == note_ptr_cookie);
return 0;
}
......@@ -295,9 +292,7 @@ gt_pch_note_reorder (void *obj, void *note_ptr_cookie,
return;
data = htab_find_with_hash (saving_htab, obj, POINTER_HASH (obj));
if (data == NULL
|| data->note_ptr_cookie != note_ptr_cookie)
abort ();
gcc_assert (data && data->note_ptr_cookie == note_ptr_cookie);
data->reorder_fn = reorder_fn;
}
......@@ -376,8 +371,7 @@ relocate_ptrs (void *ptr_p, void *state_p)
return;
result = htab_find_with_hash (saving_htab, *ptr, POINTER_HASH (*ptr));
if (result == NULL)
abort ();
gcc_assert (result);
*ptr = result->new_addr;
}
......@@ -873,8 +867,7 @@ ggc_record_overhead (size_t allocated, size_t overhead, void *ptr,
if (!ptr_hash)
ptr_hash = htab_create (10, hash_ptr, eq_ptr, NULL);
slot = htab_find_slot_with_hash (ptr_hash, ptr, htab_hash_pointer (ptr), INSERT);
if (*slot)
abort ();
gcc_assert (!*slot);
*slot = p;
loc->times++;
......
......@@ -821,8 +821,7 @@ alloc_page (unsigned order)
enda -= G.pagesize;
tail_slop += G.pagesize;
}
if (tail_slop < sizeof (page_group))
abort ();
gcc_assert (tail_slop >= sizeof (page_group));
group = (page_group *)enda;
tail_slop -= sizeof (page_group);
}
......@@ -930,22 +929,16 @@ free_page (page_entry *entry)
if (G.by_depth_in_use > 1)
{
page_entry *top = G.by_depth[G.by_depth_in_use-1];
/* If they are at the same depth, put top element into freed
slot. */
if (entry->context_depth == top->context_depth)
{
int i = entry->index_by_depth;
G.by_depth[i] = top;
G.save_in_use[i] = G.save_in_use[G.by_depth_in_use-1];
top->index_by_depth = i;
}
else
{
/* We cannot free a page from a context deeper than the
current one. */
abort ();
}
int i = entry->index_by_depth;
/* We cannot free a page from a context deeper than the current
one. */
gcc_assert (entry->context_depth == top->context_depth);
/* Put top element into freed slot. */
G.by_depth[i] = top;
G.save_in_use[i] = G.save_in_use[G.by_depth_in_use-1];
top->index_by_depth = i;
}
--G.by_depth_in_use;
......@@ -1259,10 +1252,7 @@ ggc_set_mark (const void *p)
/* Look up the page on which the object is alloced. If the object
wasn't allocated by the collector, we'll probably die. */
entry = lookup_page_table_entry (p);
#ifdef ENABLE_CHECKING
if (entry == NULL)
abort ();
#endif
gcc_assert (entry);
/* Calculate the index of the object on the page; this is its bit
position in the in_use_p bitmap. */
......@@ -1298,10 +1288,7 @@ ggc_marked_p (const void *p)
/* Look up the page on which the object is alloced. If the object
wasn't allocated by the collector, we'll probably die. */
entry = lookup_page_table_entry (p);
#ifdef ENABLE_CHECKING
if (entry == NULL)
abort ();
#endif
gcc_assert (entry);
/* Calculate the index of the object on the page; this is its bit
position in the in_use_p bitmap. */
......@@ -1474,8 +1461,7 @@ init_ggc (void)
can't get something useful, give up. */
p = alloc_anon (NULL, G.pagesize);
if ((size_t)p & (G.pagesize - 1))
abort ();
gcc_assert (!((size_t)p & (G.pagesize - 1)));
}
/* We have a good page, might as well hold onto it... */
......@@ -1556,8 +1542,7 @@ ggc_push_context (void)
++G.context_depth;
/* Die on wrap. */
if (G.context_depth >= HOST_BITS_PER_LONG)
abort ();
gcc_assert (G.context_depth < HOST_BITS_PER_LONG);
}
/* Merge the SAVE_IN_USE_P and IN_USE_P arrays in P so that IN_USE_P
......@@ -1593,8 +1578,7 @@ ggc_recalculate_in_use_p (page_entry *p)
p->num_free_objects -= (j & 1);
}
if (p->num_free_objects >= num_objects)
abort ();
gcc_assert (p->num_free_objects < num_objects);
}
/* Decrement the `GC context'. All objects allocated since the
......@@ -1634,18 +1618,12 @@ ggc_pop_context (void)
recalculate the in use bits. */
for (i = G.depth[depth]; i < e; ++i)
{
page_entry *p;
#ifdef ENABLE_CHECKING
p = G.by_depth[i];
page_entry *p = G.by_depth[i];
/* Check that all of the pages really are at the depth that
we expect. */
if (p->context_depth != depth)
abort ();
if (p->index_by_depth != i)
abort ();
#endif
gcc_assert (p->context_depth == depth);
gcc_assert (p->index_by_depth == i);
prefetch (&save_in_use_p_i (i+8));
prefetch (&save_in_use_p_i (i+16));
......@@ -1667,12 +1645,8 @@ ggc_pop_context (void)
/* Check that all of the pages really are at the depth we
expect. */
#ifdef ENABLE_CHECKING
if (p->context_depth <= depth)
abort ();
if (p->index_by_depth != i)
abort ();
#endif
gcc_assert (p->context_depth > depth);
gcc_assert (p->index_by_depth == i);
p->context_depth = depth;
}
......@@ -1684,12 +1658,8 @@ ggc_pop_context (void)
page_entry *p;
for (p = G.pages[order]; p != NULL; p = p->next)
{
if (p->context_depth > depth)
abort ();
else if (p->context_depth == depth && save_in_use_p (p))
abort ();
}
gcc_assert (p->context_depth < depth ||
(p->context_depth == depth && !save_in_use_p (p)));
}
#endif
}
......@@ -1710,11 +1680,8 @@ clear_marks (void)
size_t num_objects = OBJECTS_IN_PAGE (p);
size_t bitmap_size = BITMAP_SIZE (num_objects + 1);
#ifdef ENABLE_CHECKING
/* The data should be page-aligned. */
if ((size_t) p->page & (G.pagesize - 1))
abort ();
#endif
gcc_assert (!((size_t) p->page & (G.pagesize - 1)));
/* Pages that aren't in the topmost context are not collected;
nevertheless, we need their in-use bit vectors to store GC
......@@ -1944,8 +1911,7 @@ validate_free_objects (void)
/* Make certain it isn't visible from any root. Notice that we
do this check before sweep_pages merges save_in_use_p. */
if (pe->in_use_p[word] & (1UL << bit))
abort ();
gcc_assert (!(pe->in_use_p[word] & (1UL << bit)));
/* If the object comes from an outer context, then retain the
free_object entry, so that we can verify that the address
......@@ -2341,8 +2307,7 @@ ggc_pch_read (FILE *f, void *addr)
/* No object read from a PCH file should ever be freed. So, set the
context depth to 1, and set the depth of all the currently-allocated
pages to be 1 too. PCH pages will have depth 0. */
if (G.context_depth != 0)
abort ();
gcc_assert (!G.context_depth);
G.context_depth = 1;
for (i = 0; i < NUM_ORDERS; i++)
{
......
......@@ -368,8 +368,7 @@ ggc_allocated_p (const void *p)
struct alloc_chunk *chunk;
chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD);
#ifdef COOKIE_CHECKING
if (chunk->magic != CHUNK_MAGIC)
abort ();
gcc_assert (chunk->magic == CHUNK_MAGIC);
#endif
if (chunk->type == 1)
return true;
......@@ -578,13 +577,11 @@ free_chunk (struct alloc_chunk *chunk, size_t size, struct alloc_zone *zone)
size_t bin = 0;
bin = SIZE_BIN_DOWN (size);
if (bin == 0)
abort ();
gcc_assert (bin);
if (bin > NUM_FREE_BINS)
bin = 0;
#ifdef COOKIE_CHECKING
if (chunk->magic != CHUNK_MAGIC && chunk->magic != DEADCHUNK_MAGIC)
abort ();
gcc_assert (chunk->magic == CHUNK_MAGIC || chunk->magic == DEADCHUNK_MAGIC);
chunk->magic = DEADCHUNK_MAGIC;
#endif
chunk->u.next_free = zone->free_chunks[bin];
......@@ -830,8 +827,7 @@ ggc_set_mark (const void *p)
chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD);
#ifdef COOKIE_CHECKING
if (chunk->magic != CHUNK_MAGIC)
abort ();
gcc_assert (chunk->magic == CHUNK_MAGIC);
#endif
if (chunk->mark)
return 1;
......@@ -854,8 +850,7 @@ ggc_marked_p (const void *p)
chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD);
#ifdef COOKIE_CHECKING
if (chunk->magic != CHUNK_MAGIC)
abort ();
gcc_assert (chunk->magic == CHUNK_MAGIC);
#endif
return chunk->mark;
}
......@@ -869,8 +864,7 @@ ggc_get_size (const void *p)
chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD);
#ifdef COOKIE_CHECKING
if (chunk->magic != CHUNK_MAGIC)
abort ();
gcc_assert (chunk->magic == CHUNK_MAGIC);
#endif
if (chunk->large)
return chunk->size * 1024;
......@@ -895,8 +889,7 @@ init_ggc (void)
G.lg_pagesize = exact_log2 (G.pagesize);
#ifdef HAVE_MMAP_DEV_ZERO
G.dev_zero_fd = open ("/dev/zero", O_RDONLY);
if (G.dev_zero_fd == -1)
abort ();
gcc_assert (G.dev_zero_fd != -1);
#endif
#if 0
......@@ -920,8 +913,7 @@ init_ggc (void)
can't get something useful, give up. */
p = alloc_anon (NULL, G.pagesize, &main_zone);
if ((size_t)p & (G.pagesize - 1))
abort ();
gcc_assert (!((size_t)p & (G.pagesize - 1)));
}
/* We have a good page, might as well hold onto it... */
......@@ -953,13 +945,11 @@ destroy_ggc_zone (struct alloc_zone * dead_zone)
struct alloc_zone *z;
for (z = G.zones; z && z->next_zone != dead_zone; z = z->next_zone)
/* Just find that zone. */ ;
/* Just find that zone. */
continue;
#ifdef ENABLE_CHECKING
/* We should have found the zone in the list. Anything else is fatal. */
if (!z)
abort ();
#endif
gcc_assert (z);
/* z is dead, baby. z is dead. */
z->dead= true;
......@@ -975,8 +965,7 @@ ggc_push_context (void)
for (zone = G.zones; zone; zone = zone->next_zone)
++(zone->context_depth);
/* Die on wrap. */
if (main_zone.context_depth >= HOST_BITS_PER_LONG)
abort ();
gcc_assert (main_zone.context_depth < HOST_BITS_PER_LONG);
}
/* Decrement the `GC context'. All objects allocated since the
......@@ -1204,8 +1193,8 @@ check_cookies (void)
struct alloc_chunk *end = (struct alloc_chunk *)(p->page + G.pagesize);
do
{
if (chunk->magic != CHUNK_MAGIC && chunk->magic != DEADCHUNK_MAGIC)
abort ();
gcc_assert (chunk->magic == CHUNK_MAGIC
|| chunk->magic == DEADCHUNK_MAGIC);
chunk = (struct alloc_chunk *)(chunk->u.data + chunk->size);
}
while (chunk < end);
......@@ -1334,8 +1323,7 @@ ggc_collect (void)
printf ("Zone `%s' is dead and will be freed.\n", dead_zone->name);
/* The zone must be empty. */
if (dead_zone->allocated != 0)
abort ();
gcc_assert (!dead_zone->allocated);
/* Unchain the dead zone, release all its pages and free it. */
zone->next_zone = zone->next_zone->next_zone;
......@@ -1415,10 +1403,7 @@ ggc_print_statistics (void)
in_use += p->bytes - CHUNK_OVERHEAD;
chunk = (struct alloc_chunk *) p->page;
overhead += CHUNK_OVERHEAD;
if (!chunk->type)
abort ();
if (chunk->mark)
abort ();
gcc_assert (chunk->type && !chunk->mark);
continue;
}
......@@ -1429,8 +1414,7 @@ ggc_print_statistics (void)
overhead += CHUNK_OVERHEAD;
if (chunk->type)
in_use += chunk->size;
if (chunk->mark)
abort ();
gcc_assert (!chunk->mark);
}
}
fprintf (stderr, "%20s %10lu%c %10lu%c %10lu%c\n",
......@@ -1439,8 +1423,7 @@ ggc_print_statistics (void)
SCALE (in_use), LABEL (in_use),
SCALE (overhead), LABEL (overhead));
if (in_use != zone->allocated)
abort ();
gcc_assert (in_use == zone->allocated);
total_overhead += overhead;
total_allocated += zone->allocated;
......
......@@ -69,8 +69,7 @@ lower_function_body (void)
tree_stmt_iterator i;
tree t, x;
if (TREE_CODE (bind) != BIND_EXPR)
abort ();
gcc_assert (TREE_CODE (bind) == BIND_EXPR);
data.block = DECL_INITIAL (current_function_decl);
BLOCK_SUBBLOCKS (data.block) = NULL_TREE;
......@@ -117,8 +116,7 @@ lower_function_body (void)
tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
}
if (data.block != DECL_INITIAL (current_function_decl))
abort ();
gcc_assert (data.block == DECL_INITIAL (current_function_decl));
BLOCK_SUBBLOCKS (data.block)
= blocks_nreverse (BLOCK_SUBBLOCKS (data.block));
......@@ -200,9 +198,12 @@ lower_stmt (tree_stmt_iterator *tsi, struct lower_data *data)
break;
default:
#ifdef ENABLE_CHECKING
print_node_brief (stderr, "", stmt, 0);
internal_error ("unexpected node");
#endif
case COMPOUND_EXPR:
abort ();
gcc_unreachable ();
}
tsi_next (tsi);
......@@ -224,15 +225,13 @@ lower_bind_expr (tree_stmt_iterator *tsi, struct lower_data *data)
/* The outermost block of the original function may not be the
outermost statement chain of the gimplified function. So we
may see the outermost block just inside the function. */
if (new_block != DECL_INITIAL (current_function_decl))
abort ();
gcc_assert (new_block == DECL_INITIAL (current_function_decl));
new_block = NULL;
}
else
{
/* We do not expect to handle duplicate blocks. */
if (TREE_ASM_WRITTEN (new_block))
abort ();
gcc_assert (!TREE_ASM_WRITTEN (new_block));
TREE_ASM_WRITTEN (new_block) = 1;
/* Block tree may get clobbered by inlining. Normally this would
......@@ -252,8 +251,7 @@ lower_bind_expr (tree_stmt_iterator *tsi, struct lower_data *data)
if (new_block)
{
if (data->block != new_block)
abort ();
gcc_assert (data->block == new_block);
BLOCK_SUBBLOCKS (new_block)
= blocks_nreverse (BLOCK_SUBBLOCKS (new_block));
......
......@@ -469,12 +469,12 @@ global_alloc (FILE *file)
&& (! current_function_has_nonlocal_label
|| REG_N_CALLS_CROSSED (i) == 0))
{
if (reg_renumber[i] < 0 && reg_may_share[i] && reg_allocno[reg_may_share[i]] >= 0)
if (reg_renumber[i] < 0
&& reg_may_share[i] && reg_allocno[reg_may_share[i]] >= 0)
reg_allocno[i] = reg_allocno[reg_may_share[i]];
else
reg_allocno[i] = max_allocno++;
if (REG_LIVE_LENGTH (i) == 0)
abort ();
gcc_assert (REG_LIVE_LENGTH (i));
}
else
reg_allocno[i] = -1;
......@@ -1886,14 +1886,15 @@ build_insn_chain (rtx first)
the previous real insn is a JUMP_INSN. */
if (b == EXIT_BLOCK_PTR)
{
for (first = NEXT_INSN (first) ; first; first = NEXT_INSN (first))
if (INSN_P (first)
&& GET_CODE (PATTERN (first)) != USE
&& ! ((GET_CODE (PATTERN (first)) == ADDR_VEC
|| GET_CODE (PATTERN (first)) == ADDR_DIFF_VEC)
&& prev_real_insn (first) != 0
&& JUMP_P (prev_real_insn (first))))
abort ();
#ifdef ENABLE_CHECKING
for (first = NEXT_INSN (first); first; first = NEXT_INSN (first))
gcc_assert (!INSN_P (first)
|| GET_CODE (PATTERN (first)) == USE
|| ((GET_CODE (PATTERN (first)) == ADDR_VEC
|| GET_CODE (PATTERN (first)) == ADDR_DIFF_VEC)
&& prev_real_insn (first) != 0
&& JUMP_P (prev_real_insn (first))));
#endif
break;
}
}
......
......@@ -398,14 +398,8 @@ clean_graph_dump_file (const char *base)
if (fp == NULL)
fatal_error ("can't open %s: %m", buf);
switch (graph_dump_format)
{
case vcg:
fputs ("graph: {\nport_sharing: no\n", fp);
break;
case no_graph:
abort ();
}
gcc_assert (graph_dump_format == vcg);
fputs ("graph: {\nport_sharing: no\n", fp);
fclose (fp);
}
......@@ -426,15 +420,8 @@ finish_graph_dump_file (const char *base)
fp = fopen (buf, "a");
if (fp != NULL)
{
switch (graph_dump_format)
{
case vcg:
fputs ("}\n", fp);
break;
case no_graph:
abort ();
}
gcc_assert (graph_dump_format == vcg);
fputs ("}\n", fp);
fclose (fp);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment