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> 2004-09-09 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.c (acc_operand, accg_operand): Use REGNO. * config/frv/frv.c (acc_operand, accg_operand): Use REGNO.
...@@ -5,7 +41,8 @@ ...@@ -5,7 +41,8 @@
2004-09-09 Jan Hubicka <jh@suse.cz> 2004-09-09 Jan Hubicka <jh@suse.cz>
middle-end/17128 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> 2004-09-09 Jan Hubicka <jh@suse.cz>
...@@ -6796,7 +6833,7 @@ ...@@ -6796,7 +6833,7 @@
* config/i386/xmmintrin.h: Include <mm_malloc.h>. * config/i386/xmmintrin.h: Include <mm_malloc.h>.
2004-08-03 H.J. Lu <hongjiu.lu@intel.com> 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. * config/i386/pmm_malloc.h: New file.
......
...@@ -74,8 +74,7 @@ gcov_open (const char *name, int mode) ...@@ -74,8 +74,7 @@ gcov_open (const char *name, int mode)
s_flock.l_pid = getpid (); s_flock.l_pid = getpid ();
#endif #endif
if (gcov_var.file) GCOV_CHECK (!gcov_var.file);
abort ();
gcov_var.start = 0; gcov_var.start = 0;
gcov_var.offset = gcov_var.length = 0; gcov_var.offset = gcov_var.length = 0;
gcov_var.overread = -1u; gcov_var.overread = -1u;
......
...@@ -389,7 +389,8 @@ static int max_uid; ...@@ -389,7 +389,8 @@ static int max_uid;
/* Get the cuid of an insn. */ /* Get the cuid of an insn. */
#ifdef ENABLE_CHECKING #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 #else
#define INSN_CUID(INSN) (uid_cuid[INSN_UID (INSN)]) #define INSN_CUID(INSN) (uid_cuid[INSN_UID (INSN)])
#endif #endif
...@@ -1644,9 +1645,7 @@ insert_set_in_table (rtx x, rtx insn, struct hash_table *table) ...@@ -1644,9 +1645,7 @@ insert_set_in_table (rtx x, rtx insn, struct hash_table *table)
struct expr *cur_expr, *last_expr = NULL; struct expr *cur_expr, *last_expr = NULL;
struct occr *cur_occr, *last_occr = NULL; struct occr *cur_occr, *last_occr = NULL;
if (GET_CODE (x) != SET gcc_assert (GET_CODE (x) == SET && REG_P (SET_DEST (x)));
|| ! REG_P (SET_DEST (x)))
abort ();
hash = hash_set (REGNO (SET_DEST (x)), table->size); hash = hash_set (REGNO (SET_DEST (x)), table->size);
...@@ -2796,8 +2795,7 @@ find_avail_set (int regno, rtx insn) ...@@ -2796,8 +2795,7 @@ find_avail_set (int regno, rtx insn)
if (set == 0) if (set == 0)
break; break;
if (GET_CODE (set->expr) != SET) gcc_assert (GET_CODE (set->expr) == SET);
abort ();
src = SET_SRC (set->expr); src = SET_SRC (set->expr);
...@@ -3013,8 +3011,7 @@ cprop_insn (rtx insn, int alter_jumps) ...@@ -3013,8 +3011,7 @@ cprop_insn (rtx insn, int alter_jumps)
pat = set->expr; pat = set->expr;
/* ??? We might be able to handle PARALLELs. Later. */ /* ??? We might be able to handle PARALLELs. Later. */
if (GET_CODE (pat) != SET) gcc_assert (GET_CODE (pat) == SET);
abort ();
src = SET_SRC (pat); src = SET_SRC (pat);
...@@ -3155,8 +3152,11 @@ do_local_cprop (rtx x, rtx insn, int alter_jumps, rtx *libcall_sp) ...@@ -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 fix delete_trivially_dead_insns to preserve the setting insn,
or make it delete the REG_EUAQL note, and fix up all passes that or make it delete the REG_EUAQL note, and fix up all passes that
require the REG_EQUAL note there. */ require the REG_EQUAL note there. */
if (!adjust_libcall_notes (x, newcnst, insn, libcall_sp)) bool adjusted;
abort ();
adjusted = adjust_libcall_notes (x, newcnst, insn, libcall_sp);
gcc_assert (adjusted);
if (gcse_file != NULL) if (gcse_file != NULL)
{ {
fprintf (gcse_file, "LOCAL CONST-PROP: Replacing reg %d in ", fprintf (gcse_file, "LOCAL CONST-PROP: Replacing reg %d in ",
...@@ -3245,8 +3245,7 @@ local_cprop_pass (int alter_jumps) ...@@ -3245,8 +3245,7 @@ local_cprop_pass (int alter_jumps)
if (note) if (note)
{ {
if (libcall_sp == libcall_stack) gcc_assert (libcall_sp != libcall_stack);
abort ();
*--libcall_sp = XEXP (note, 0); *--libcall_sp = XEXP (note, 0);
} }
note = find_reg_note (insn, REG_RETVAL, NULL_RTX); note = find_reg_note (insn, REG_RETVAL, NULL_RTX);
...@@ -3520,8 +3519,7 @@ find_bypass_set (int regno, int bb) ...@@ -3520,8 +3519,7 @@ find_bypass_set (int regno, int bb)
if (set == 0) if (set == 0)
break; break;
if (GET_CODE (set->expr) != SET) gcc_assert (GET_CODE (set->expr) == SET);
abort ();
src = SET_SRC (set->expr); src = SET_SRC (set->expr);
if (gcse_constant_p (src)) if (gcse_constant_p (src))
...@@ -4004,8 +4002,13 @@ process_insert_insn (struct expr *expr) ...@@ -4004,8 +4002,13 @@ process_insert_insn (struct expr *expr)
/* Otherwise, make a new insn to compute this expression and make sure the /* 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 insn will be recognized (this also adds any needed CLOBBERs). Copy the
expression to make sure we don't have any sharing issues. */ expression to make sure we don't have any sharing issues. */
else if (insn_invalid_p (emit_insn (gen_rtx_SET (VOIDmode, reg, exp)))) else
abort (); {
rtx insn = emit_insn (gen_rtx_SET (VOIDmode, reg, exp));
gcc_assert (!insn_invalid_p (insn));
}
pat = get_insns (); pat = get_insns ();
end_sequence (); end_sequence ();
...@@ -4031,8 +4034,7 @@ insert_insn_end_bb (struct expr *expr, basic_block bb, int pre) ...@@ -4031,8 +4034,7 @@ insert_insn_end_bb (struct expr *expr, basic_block bb, int pre)
rtx pat, pat_end; rtx pat, pat_end;
pat = process_insert_insn (expr); pat = process_insert_insn (expr);
if (pat == NULL_RTX || ! INSN_P (pat)) gcc_assert (pat && INSN_P (pat));
abort ();
pat_end = pat; pat_end = pat;
while (NEXT_INSN (pat_end) != NULL_RTX) while (NEXT_INSN (pat_end) != NULL_RTX)
...@@ -4052,10 +4054,9 @@ insert_insn_end_bb (struct expr *expr, basic_block bb, int pre) ...@@ -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 /* It should always be the case that we can put these instructions
anywhere in the basic block with performing PRE optimizations. anywhere in the basic block with performing PRE optimizations.
Check this. */ Check this. */
if (NONJUMP_INSN_P (insn) && pre gcc_assert (!NONJUMP_INSN_P (insn) || !pre
&& !TEST_BIT (antloc[bb->index], expr->bitmap_index) || TEST_BIT (antloc[bb->index], expr->bitmap_index)
&& !TEST_BIT (transp[bb->index], expr->bitmap_index)) || TEST_BIT (transp[bb->index], expr->bitmap_index));
abort ();
/* If this is a jump table, then we can't insert stuff here. Since /* 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 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) ...@@ -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. anywhere in the basic block with performing PRE optimizations.
Check this. */ Check this. */
if (pre gcc_assert (!pre
&& !TEST_BIT (antloc[bb->index], expr->bitmap_index) || TEST_BIT (antloc[bb->index], expr->bitmap_index)
&& !TEST_BIT (transp[bb->index], expr->bitmap_index)) || TEST_BIT (transp[bb->index], expr->bitmap_index));
abort ();
/* Since different machines initialize their parameter registers /* Since different machines initialize their parameter registers
in different orders, assume nothing. Collect the set of all in different orders, assume nothing. Collect the set of all
...@@ -4257,10 +4257,13 @@ pre_insert_copy_insn (struct expr *expr, rtx insn) ...@@ -4257,10 +4257,13 @@ pre_insert_copy_insn (struct expr *expr, rtx insn)
int i; int i;
/* This block matches the logic in hash_scan_insn. */ /* This block matches the logic in hash_scan_insn. */
if (GET_CODE (pat) == SET) switch (GET_CODE (pat))
set = pat;
else if (GET_CODE (pat) == PARALLEL)
{ {
case SET:
set = pat;
break;
case PARALLEL:
/* Search through the parallel looking for the set whose /* Search through the parallel looking for the set whose
source was the expression that we're interested in. */ source was the expression that we're interested in. */
set = NULL_RTX; set = NULL_RTX;
...@@ -4274,9 +4277,11 @@ pre_insert_copy_insn (struct expr *expr, rtx insn) ...@@ -4274,9 +4277,11 @@ pre_insert_copy_insn (struct expr *expr, rtx insn)
break; break;
} }
} }
break;
default:
gcc_unreachable ();
} }
else
abort ();
if (REG_P (SET_DEST (set))) if (REG_P (SET_DEST (set)))
{ {
...@@ -4970,15 +4975,10 @@ hoist_code (void) ...@@ -4970,15 +4975,10 @@ hoist_code (void)
while (BLOCK_FOR_INSN (occr->insn) != dominated && occr) while (BLOCK_FOR_INSN (occr->insn) != dominated && occr)
occr = occr->next; occr = occr->next;
/* Should never happen. */ gcc_assert (occr);
if (!occr)
abort ();
insn = occr->insn; insn = occr->insn;
set = single_set (insn); set = single_set (insn);
if (! set) gcc_assert (set);
abort ();
/* Create a pseudo-reg to store the result of reaching /* Create a pseudo-reg to store the result of reaching
expressions into. Get the mode for the new pseudo expressions into. Get the mode for the new pseudo
...@@ -5556,7 +5556,7 @@ extract_mentioned_regs_helper (rtx x, rtx accum) ...@@ -5556,7 +5556,7 @@ extract_mentioned_regs_helper (rtx x, rtx accum)
case POST_DEC: case POST_DEC:
case POST_INC: case POST_INC:
/* We do not run this function with arguments having side effects. */ /* We do not run this function with arguments having side effects. */
abort (); gcc_unreachable ();
case PC: case PC:
case CC0: /*FIXME*/ case CC0: /*FIXME*/
...@@ -5830,8 +5830,7 @@ compute_store_table (void) ...@@ -5830,8 +5830,7 @@ compute_store_table (void)
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
/* last_set_in should now be all-zero. */ /* last_set_in should now be all-zero. */
for (regno = 0; regno < max_gcse_regno; regno++) for (regno = 0; regno < max_gcse_regno; regno++)
if (last_set_in[regno] != 0) gcc_assert (!last_set_in[regno]);
abort ();
#endif #endif
/* Clear temporary marks. */ /* Clear temporary marks. */
...@@ -6204,8 +6203,8 @@ insert_store (struct ls_expr * expr, edge e) ...@@ -6204,8 +6203,8 @@ insert_store (struct ls_expr * expr, edge e)
if (!(tmp->flags & EDGE_FAKE)) if (!(tmp->flags & EDGE_FAKE))
{ {
int index = EDGE_INDEX (edge_list, tmp->src, tmp->dest); 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)) if (! TEST_BIT (pre_insert_map[index], expr->index))
break; break;
} }
......
...@@ -197,16 +197,14 @@ ggc_calloc (size_t s1, size_t s2) ...@@ -197,16 +197,14 @@ ggc_calloc (size_t s1, size_t s2)
void * void *
ggc_splay_alloc (int sz, void *nl) ggc_splay_alloc (int sz, void *nl)
{ {
if (nl != NULL) gcc_assert (!nl);
abort ();
return ggc_alloc (sz); return ggc_alloc (sz);
} }
void void
ggc_splay_dont_free (void * x ATTRIBUTE_UNUSED, void *nl) ggc_splay_dont_free (void * x ATTRIBUTE_UNUSED, void *nl)
{ {
if (nl != NULL) gcc_assert (!nl);
abort ();
} }
/* Print statistics that are independent of the collector in use. */ /* Print statistics that are independent of the collector in use. */
...@@ -266,9 +264,8 @@ gt_pch_note_object (void *obj, void *note_ptr_cookie, ...@@ -266,9 +264,8 @@ gt_pch_note_object (void *obj, void *note_ptr_cookie,
INSERT); INSERT);
if (*slot != NULL) if (*slot != NULL)
{ {
if ((*slot)->note_ptr_fn != note_ptr_fn gcc_assert ((*slot)->note_ptr_fn == note_ptr_fn
|| (*slot)->note_ptr_cookie != note_ptr_cookie) && (*slot)->note_ptr_cookie == note_ptr_cookie);
abort ();
return 0; return 0;
} }
...@@ -295,9 +292,7 @@ gt_pch_note_reorder (void *obj, void *note_ptr_cookie, ...@@ -295,9 +292,7 @@ gt_pch_note_reorder (void *obj, void *note_ptr_cookie,
return; return;
data = htab_find_with_hash (saving_htab, obj, POINTER_HASH (obj)); data = htab_find_with_hash (saving_htab, obj, POINTER_HASH (obj));
if (data == NULL gcc_assert (data && data->note_ptr_cookie == note_ptr_cookie);
|| data->note_ptr_cookie != note_ptr_cookie)
abort ();
data->reorder_fn = reorder_fn; data->reorder_fn = reorder_fn;
} }
...@@ -376,8 +371,7 @@ relocate_ptrs (void *ptr_p, void *state_p) ...@@ -376,8 +371,7 @@ relocate_ptrs (void *ptr_p, void *state_p)
return; return;
result = htab_find_with_hash (saving_htab, *ptr, POINTER_HASH (*ptr)); result = htab_find_with_hash (saving_htab, *ptr, POINTER_HASH (*ptr));
if (result == NULL) gcc_assert (result);
abort ();
*ptr = result->new_addr; *ptr = result->new_addr;
} }
...@@ -873,8 +867,7 @@ ggc_record_overhead (size_t allocated, size_t overhead, void *ptr, ...@@ -873,8 +867,7 @@ ggc_record_overhead (size_t allocated, size_t overhead, void *ptr,
if (!ptr_hash) if (!ptr_hash)
ptr_hash = htab_create (10, hash_ptr, eq_ptr, NULL); ptr_hash = htab_create (10, hash_ptr, eq_ptr, NULL);
slot = htab_find_slot_with_hash (ptr_hash, ptr, htab_hash_pointer (ptr), INSERT); slot = htab_find_slot_with_hash (ptr_hash, ptr, htab_hash_pointer (ptr), INSERT);
if (*slot) gcc_assert (!*slot);
abort ();
*slot = p; *slot = p;
loc->times++; loc->times++;
......
...@@ -821,8 +821,7 @@ alloc_page (unsigned order) ...@@ -821,8 +821,7 @@ alloc_page (unsigned order)
enda -= G.pagesize; enda -= G.pagesize;
tail_slop += G.pagesize; tail_slop += G.pagesize;
} }
if (tail_slop < sizeof (page_group)) gcc_assert (tail_slop >= sizeof (page_group));
abort ();
group = (page_group *)enda; group = (page_group *)enda;
tail_slop -= sizeof (page_group); tail_slop -= sizeof (page_group);
} }
...@@ -930,22 +929,16 @@ free_page (page_entry *entry) ...@@ -930,22 +929,16 @@ free_page (page_entry *entry)
if (G.by_depth_in_use > 1) if (G.by_depth_in_use > 1)
{ {
page_entry *top = G.by_depth[G.by_depth_in_use-1]; page_entry *top = G.by_depth[G.by_depth_in_use-1];
int i = entry->index_by_depth;
/* If they are at the same depth, put top element into freed
slot. */ /* We cannot free a page from a context deeper than the current
if (entry->context_depth == top->context_depth) one. */
{ gcc_assert (entry->context_depth == top->context_depth);
int i = entry->index_by_depth;
G.by_depth[i] = top; /* Put top element into freed slot. */
G.save_in_use[i] = G.save_in_use[G.by_depth_in_use-1]; G.by_depth[i] = top;
top->index_by_depth = i; 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 ();
}
} }
--G.by_depth_in_use; --G.by_depth_in_use;
...@@ -1259,10 +1252,7 @@ ggc_set_mark (const void *p) ...@@ -1259,10 +1252,7 @@ ggc_set_mark (const void *p)
/* Look up the page on which the object is alloced. If the object /* Look up the page on which the object is alloced. If the object
wasn't allocated by the collector, we'll probably die. */ wasn't allocated by the collector, we'll probably die. */
entry = lookup_page_table_entry (p); entry = lookup_page_table_entry (p);
#ifdef ENABLE_CHECKING gcc_assert (entry);
if (entry == NULL)
abort ();
#endif
/* Calculate the index of the object on the page; this is its bit /* Calculate the index of the object on the page; this is its bit
position in the in_use_p bitmap. */ position in the in_use_p bitmap. */
...@@ -1298,10 +1288,7 @@ ggc_marked_p (const void *p) ...@@ -1298,10 +1288,7 @@ ggc_marked_p (const void *p)
/* Look up the page on which the object is alloced. If the object /* Look up the page on which the object is alloced. If the object
wasn't allocated by the collector, we'll probably die. */ wasn't allocated by the collector, we'll probably die. */
entry = lookup_page_table_entry (p); entry = lookup_page_table_entry (p);
#ifdef ENABLE_CHECKING gcc_assert (entry);
if (entry == NULL)
abort ();
#endif
/* Calculate the index of the object on the page; this is its bit /* Calculate the index of the object on the page; this is its bit
position in the in_use_p bitmap. */ position in the in_use_p bitmap. */
...@@ -1474,8 +1461,7 @@ init_ggc (void) ...@@ -1474,8 +1461,7 @@ init_ggc (void)
can't get something useful, give up. */ can't get something useful, give up. */
p = alloc_anon (NULL, G.pagesize); p = alloc_anon (NULL, G.pagesize);
if ((size_t)p & (G.pagesize - 1)) gcc_assert (!((size_t)p & (G.pagesize - 1)));
abort ();
} }
/* We have a good page, might as well hold onto it... */ /* We have a good page, might as well hold onto it... */
...@@ -1556,8 +1542,7 @@ ggc_push_context (void) ...@@ -1556,8 +1542,7 @@ ggc_push_context (void)
++G.context_depth; ++G.context_depth;
/* Die on wrap. */ /* Die on wrap. */
if (G.context_depth >= HOST_BITS_PER_LONG) gcc_assert (G.context_depth < HOST_BITS_PER_LONG);
abort ();
} }
/* Merge the SAVE_IN_USE_P and IN_USE_P arrays in P so that IN_USE_P /* 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) ...@@ -1593,8 +1578,7 @@ ggc_recalculate_in_use_p (page_entry *p)
p->num_free_objects -= (j & 1); p->num_free_objects -= (j & 1);
} }
if (p->num_free_objects >= num_objects) gcc_assert (p->num_free_objects < num_objects);
abort ();
} }
/* Decrement the `GC context'. All objects allocated since the /* Decrement the `GC context'. All objects allocated since the
...@@ -1634,18 +1618,12 @@ ggc_pop_context (void) ...@@ -1634,18 +1618,12 @@ ggc_pop_context (void)
recalculate the in use bits. */ recalculate the in use bits. */
for (i = G.depth[depth]; i < e; ++i) for (i = G.depth[depth]; i < e; ++i)
{ {
page_entry *p; page_entry *p = G.by_depth[i];
#ifdef ENABLE_CHECKING
p = G.by_depth[i];
/* Check that all of the pages really are at the depth that /* Check that all of the pages really are at the depth that
we expect. */ we expect. */
if (p->context_depth != depth) gcc_assert (p->context_depth == depth);
abort (); gcc_assert (p->index_by_depth == i);
if (p->index_by_depth != i)
abort ();
#endif
prefetch (&save_in_use_p_i (i+8)); prefetch (&save_in_use_p_i (i+8));
prefetch (&save_in_use_p_i (i+16)); prefetch (&save_in_use_p_i (i+16));
...@@ -1667,12 +1645,8 @@ ggc_pop_context (void) ...@@ -1667,12 +1645,8 @@ ggc_pop_context (void)
/* Check that all of the pages really are at the depth we /* Check that all of the pages really are at the depth we
expect. */ expect. */
#ifdef ENABLE_CHECKING gcc_assert (p->context_depth > depth);
if (p->context_depth <= depth) gcc_assert (p->index_by_depth == i);
abort ();
if (p->index_by_depth != i)
abort ();
#endif
p->context_depth = depth; p->context_depth = depth;
} }
...@@ -1684,12 +1658,8 @@ ggc_pop_context (void) ...@@ -1684,12 +1658,8 @@ ggc_pop_context (void)
page_entry *p; page_entry *p;
for (p = G.pages[order]; p != NULL; p = p->next) for (p = G.pages[order]; p != NULL; p = p->next)
{ gcc_assert (p->context_depth < depth ||
if (p->context_depth > depth) (p->context_depth == depth && !save_in_use_p (p)));
abort ();
else if (p->context_depth == depth && save_in_use_p (p))
abort ();
}
} }
#endif #endif
} }
...@@ -1710,11 +1680,8 @@ clear_marks (void) ...@@ -1710,11 +1680,8 @@ clear_marks (void)
size_t num_objects = OBJECTS_IN_PAGE (p); size_t num_objects = OBJECTS_IN_PAGE (p);
size_t bitmap_size = BITMAP_SIZE (num_objects + 1); size_t bitmap_size = BITMAP_SIZE (num_objects + 1);
#ifdef ENABLE_CHECKING
/* The data should be page-aligned. */ /* The data should be page-aligned. */
if ((size_t) p->page & (G.pagesize - 1)) gcc_assert (!((size_t) p->page & (G.pagesize - 1)));
abort ();
#endif
/* Pages that aren't in the topmost context are not collected; /* Pages that aren't in the topmost context are not collected;
nevertheless, we need their in-use bit vectors to store GC nevertheless, we need their in-use bit vectors to store GC
...@@ -1944,8 +1911,7 @@ validate_free_objects (void) ...@@ -1944,8 +1911,7 @@ validate_free_objects (void)
/* Make certain it isn't visible from any root. Notice that we /* Make certain it isn't visible from any root. Notice that we
do this check before sweep_pages merges save_in_use_p. */ do this check before sweep_pages merges save_in_use_p. */
if (pe->in_use_p[word] & (1UL << bit)) gcc_assert (!(pe->in_use_p[word] & (1UL << bit)));
abort ();
/* If the object comes from an outer context, then retain the /* If the object comes from an outer context, then retain the
free_object entry, so that we can verify that the address free_object entry, so that we can verify that the address
...@@ -2341,8 +2307,7 @@ ggc_pch_read (FILE *f, void *addr) ...@@ -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 /* 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 context depth to 1, and set the depth of all the currently-allocated
pages to be 1 too. PCH pages will have depth 0. */ pages to be 1 too. PCH pages will have depth 0. */
if (G.context_depth != 0) gcc_assert (!G.context_depth);
abort ();
G.context_depth = 1; G.context_depth = 1;
for (i = 0; i < NUM_ORDERS; i++) for (i = 0; i < NUM_ORDERS; i++)
{ {
......
...@@ -368,8 +368,7 @@ ggc_allocated_p (const void *p) ...@@ -368,8 +368,7 @@ ggc_allocated_p (const void *p)
struct alloc_chunk *chunk; struct alloc_chunk *chunk;
chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD); chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD);
#ifdef COOKIE_CHECKING #ifdef COOKIE_CHECKING
if (chunk->magic != CHUNK_MAGIC) gcc_assert (chunk->magic == CHUNK_MAGIC);
abort ();
#endif #endif
if (chunk->type == 1) if (chunk->type == 1)
return true; return true;
...@@ -578,13 +577,11 @@ free_chunk (struct alloc_chunk *chunk, size_t size, struct alloc_zone *zone) ...@@ -578,13 +577,11 @@ free_chunk (struct alloc_chunk *chunk, size_t size, struct alloc_zone *zone)
size_t bin = 0; size_t bin = 0;
bin = SIZE_BIN_DOWN (size); bin = SIZE_BIN_DOWN (size);
if (bin == 0) gcc_assert (bin);
abort ();
if (bin > NUM_FREE_BINS) if (bin > NUM_FREE_BINS)
bin = 0; bin = 0;
#ifdef COOKIE_CHECKING #ifdef COOKIE_CHECKING
if (chunk->magic != CHUNK_MAGIC && chunk->magic != DEADCHUNK_MAGIC) gcc_assert (chunk->magic == CHUNK_MAGIC || chunk->magic == DEADCHUNK_MAGIC);
abort ();
chunk->magic = DEADCHUNK_MAGIC; chunk->magic = DEADCHUNK_MAGIC;
#endif #endif
chunk->u.next_free = zone->free_chunks[bin]; chunk->u.next_free = zone->free_chunks[bin];
...@@ -830,8 +827,7 @@ ggc_set_mark (const void *p) ...@@ -830,8 +827,7 @@ ggc_set_mark (const void *p)
chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD); chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD);
#ifdef COOKIE_CHECKING #ifdef COOKIE_CHECKING
if (chunk->magic != CHUNK_MAGIC) gcc_assert (chunk->magic == CHUNK_MAGIC);
abort ();
#endif #endif
if (chunk->mark) if (chunk->mark)
return 1; return 1;
...@@ -854,8 +850,7 @@ ggc_marked_p (const void *p) ...@@ -854,8 +850,7 @@ ggc_marked_p (const void *p)
chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD); chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD);
#ifdef COOKIE_CHECKING #ifdef COOKIE_CHECKING
if (chunk->magic != CHUNK_MAGIC) gcc_assert (chunk->magic == CHUNK_MAGIC);
abort ();
#endif #endif
return chunk->mark; return chunk->mark;
} }
...@@ -869,8 +864,7 @@ ggc_get_size (const void *p) ...@@ -869,8 +864,7 @@ ggc_get_size (const void *p)
chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD); chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD);
#ifdef COOKIE_CHECKING #ifdef COOKIE_CHECKING
if (chunk->magic != CHUNK_MAGIC) gcc_assert (chunk->magic == CHUNK_MAGIC);
abort ();
#endif #endif
if (chunk->large) if (chunk->large)
return chunk->size * 1024; return chunk->size * 1024;
...@@ -895,8 +889,7 @@ init_ggc (void) ...@@ -895,8 +889,7 @@ init_ggc (void)
G.lg_pagesize = exact_log2 (G.pagesize); G.lg_pagesize = exact_log2 (G.pagesize);
#ifdef HAVE_MMAP_DEV_ZERO #ifdef HAVE_MMAP_DEV_ZERO
G.dev_zero_fd = open ("/dev/zero", O_RDONLY); G.dev_zero_fd = open ("/dev/zero", O_RDONLY);
if (G.dev_zero_fd == -1) gcc_assert (G.dev_zero_fd != -1);
abort ();
#endif #endif
#if 0 #if 0
...@@ -920,8 +913,7 @@ init_ggc (void) ...@@ -920,8 +913,7 @@ init_ggc (void)
can't get something useful, give up. */ can't get something useful, give up. */
p = alloc_anon (NULL, G.pagesize, &main_zone); p = alloc_anon (NULL, G.pagesize, &main_zone);
if ((size_t)p & (G.pagesize - 1)) gcc_assert (!((size_t)p & (G.pagesize - 1)));
abort ();
} }
/* We have a good page, might as well hold onto it... */ /* We have a good page, might as well hold onto it... */
...@@ -953,13 +945,11 @@ destroy_ggc_zone (struct alloc_zone * dead_zone) ...@@ -953,13 +945,11 @@ destroy_ggc_zone (struct alloc_zone * dead_zone)
struct alloc_zone *z; struct alloc_zone *z;
for (z = G.zones; z && z->next_zone != dead_zone; z = z->next_zone) 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. */ /* We should have found the zone in the list. Anything else is fatal. */
if (!z) gcc_assert (z);
abort ();
#endif
/* z is dead, baby. z is dead. */ /* z is dead, baby. z is dead. */
z->dead= true; z->dead= true;
...@@ -975,8 +965,7 @@ ggc_push_context (void) ...@@ -975,8 +965,7 @@ ggc_push_context (void)
for (zone = G.zones; zone; zone = zone->next_zone) for (zone = G.zones; zone; zone = zone->next_zone)
++(zone->context_depth); ++(zone->context_depth);
/* Die on wrap. */ /* Die on wrap. */
if (main_zone.context_depth >= HOST_BITS_PER_LONG) gcc_assert (main_zone.context_depth < HOST_BITS_PER_LONG);
abort ();
} }
/* Decrement the `GC context'. All objects allocated since the /* Decrement the `GC context'. All objects allocated since the
...@@ -1204,8 +1193,8 @@ check_cookies (void) ...@@ -1204,8 +1193,8 @@ check_cookies (void)
struct alloc_chunk *end = (struct alloc_chunk *)(p->page + G.pagesize); struct alloc_chunk *end = (struct alloc_chunk *)(p->page + G.pagesize);
do do
{ {
if (chunk->magic != CHUNK_MAGIC && chunk->magic != DEADCHUNK_MAGIC) gcc_assert (chunk->magic == CHUNK_MAGIC
abort (); || chunk->magic == DEADCHUNK_MAGIC);
chunk = (struct alloc_chunk *)(chunk->u.data + chunk->size); chunk = (struct alloc_chunk *)(chunk->u.data + chunk->size);
} }
while (chunk < end); while (chunk < end);
...@@ -1334,8 +1323,7 @@ ggc_collect (void) ...@@ -1334,8 +1323,7 @@ ggc_collect (void)
printf ("Zone `%s' is dead and will be freed.\n", dead_zone->name); printf ("Zone `%s' is dead and will be freed.\n", dead_zone->name);
/* The zone must be empty. */ /* The zone must be empty. */
if (dead_zone->allocated != 0) gcc_assert (!dead_zone->allocated);
abort ();
/* Unchain the dead zone, release all its pages and free it. */ /* Unchain the dead zone, release all its pages and free it. */
zone->next_zone = zone->next_zone->next_zone; zone->next_zone = zone->next_zone->next_zone;
...@@ -1415,10 +1403,7 @@ ggc_print_statistics (void) ...@@ -1415,10 +1403,7 @@ ggc_print_statistics (void)
in_use += p->bytes - CHUNK_OVERHEAD; in_use += p->bytes - CHUNK_OVERHEAD;
chunk = (struct alloc_chunk *) p->page; chunk = (struct alloc_chunk *) p->page;
overhead += CHUNK_OVERHEAD; overhead += CHUNK_OVERHEAD;
if (!chunk->type) gcc_assert (chunk->type && !chunk->mark);
abort ();
if (chunk->mark)
abort ();
continue; continue;
} }
...@@ -1429,8 +1414,7 @@ ggc_print_statistics (void) ...@@ -1429,8 +1414,7 @@ ggc_print_statistics (void)
overhead += CHUNK_OVERHEAD; overhead += CHUNK_OVERHEAD;
if (chunk->type) if (chunk->type)
in_use += chunk->size; in_use += chunk->size;
if (chunk->mark) gcc_assert (!chunk->mark);
abort ();
} }
} }
fprintf (stderr, "%20s %10lu%c %10lu%c %10lu%c\n", fprintf (stderr, "%20s %10lu%c %10lu%c %10lu%c\n",
...@@ -1439,8 +1423,7 @@ ggc_print_statistics (void) ...@@ -1439,8 +1423,7 @@ ggc_print_statistics (void)
SCALE (in_use), LABEL (in_use), SCALE (in_use), LABEL (in_use),
SCALE (overhead), LABEL (overhead)); SCALE (overhead), LABEL (overhead));
if (in_use != zone->allocated) gcc_assert (in_use == zone->allocated);
abort ();
total_overhead += overhead; total_overhead += overhead;
total_allocated += zone->allocated; total_allocated += zone->allocated;
......
...@@ -69,8 +69,7 @@ lower_function_body (void) ...@@ -69,8 +69,7 @@ lower_function_body (void)
tree_stmt_iterator i; tree_stmt_iterator i;
tree t, x; tree t, x;
if (TREE_CODE (bind) != BIND_EXPR) gcc_assert (TREE_CODE (bind) == BIND_EXPR);
abort ();
data.block = DECL_INITIAL (current_function_decl); data.block = DECL_INITIAL (current_function_decl);
BLOCK_SUBBLOCKS (data.block) = NULL_TREE; BLOCK_SUBBLOCKS (data.block) = NULL_TREE;
...@@ -117,8 +116,7 @@ lower_function_body (void) ...@@ -117,8 +116,7 @@ lower_function_body (void)
tsi_link_after (&i, x, TSI_CONTINUE_LINKING); tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
} }
if (data.block != DECL_INITIAL (current_function_decl)) gcc_assert (data.block == DECL_INITIAL (current_function_decl));
abort ();
BLOCK_SUBBLOCKS (data.block) BLOCK_SUBBLOCKS (data.block)
= blocks_nreverse (BLOCK_SUBBLOCKS (data.block)); = blocks_nreverse (BLOCK_SUBBLOCKS (data.block));
...@@ -200,9 +198,12 @@ lower_stmt (tree_stmt_iterator *tsi, struct lower_data *data) ...@@ -200,9 +198,12 @@ lower_stmt (tree_stmt_iterator *tsi, struct lower_data *data)
break; break;
default: default:
#ifdef ENABLE_CHECKING
print_node_brief (stderr, "", stmt, 0); print_node_brief (stderr, "", stmt, 0);
internal_error ("unexpected node");
#endif
case COMPOUND_EXPR: case COMPOUND_EXPR:
abort (); gcc_unreachable ();
} }
tsi_next (tsi); tsi_next (tsi);
...@@ -224,15 +225,13 @@ lower_bind_expr (tree_stmt_iterator *tsi, struct lower_data *data) ...@@ -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 /* The outermost block of the original function may not be the
outermost statement chain of the gimplified function. So we outermost statement chain of the gimplified function. So we
may see the outermost block just inside the function. */ may see the outermost block just inside the function. */
if (new_block != DECL_INITIAL (current_function_decl)) gcc_assert (new_block == DECL_INITIAL (current_function_decl));
abort ();
new_block = NULL; new_block = NULL;
} }
else else
{ {
/* We do not expect to handle duplicate blocks. */ /* We do not expect to handle duplicate blocks. */
if (TREE_ASM_WRITTEN (new_block)) gcc_assert (!TREE_ASM_WRITTEN (new_block));
abort ();
TREE_ASM_WRITTEN (new_block) = 1; TREE_ASM_WRITTEN (new_block) = 1;
/* Block tree may get clobbered by inlining. Normally this would /* 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) ...@@ -252,8 +251,7 @@ lower_bind_expr (tree_stmt_iterator *tsi, struct lower_data *data)
if (new_block) if (new_block)
{ {
if (data->block != new_block) gcc_assert (data->block == new_block);
abort ();
BLOCK_SUBBLOCKS (new_block) BLOCK_SUBBLOCKS (new_block)
= blocks_nreverse (BLOCK_SUBBLOCKS (new_block)); = blocks_nreverse (BLOCK_SUBBLOCKS (new_block));
......
...@@ -103,8 +103,7 @@ gimple_tree_eq (const void *p1, const void *p2) ...@@ -103,8 +103,7 @@ gimple_tree_eq (const void *p1, const void *p2)
/* Only allow them to compare equal if they also hash equal; otherwise /* Only allow them to compare equal if they also hash equal; otherwise
results are nondeterminate, and we fail bootstrap comparison. */ results are nondeterminate, and we fail bootstrap comparison. */
if (gimple_tree_hash (p1) != gimple_tree_hash (p2)) gcc_assert (gimple_tree_hash (p1) == gimple_tree_hash (p2));
abort ();
return 1; return 1;
} }
...@@ -114,8 +113,7 @@ gimple_tree_eq (const void *p1, const void *p2) ...@@ -114,8 +113,7 @@ gimple_tree_eq (const void *p1, const void *p2)
void void
push_gimplify_context (void) push_gimplify_context (void)
{ {
if (gimplify_ctxp) gcc_assert (!gimplify_ctxp);
abort ();
gimplify_ctxp gimplify_ctxp
= (struct gimplify_ctx *) xcalloc (1, sizeof (struct gimplify_ctx)); = (struct gimplify_ctx *) xcalloc (1, sizeof (struct gimplify_ctx));
if (optimize) if (optimize)
...@@ -134,8 +132,7 @@ pop_gimplify_context (tree body) ...@@ -134,8 +132,7 @@ pop_gimplify_context (tree body)
{ {
tree t; tree t;
if (!gimplify_ctxp || gimplify_ctxp->current_bind_expr) gcc_assert (gimplify_ctxp && !gimplify_ctxp->current_bind_expr);
abort ();
for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t)) for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t))
DECL_GIMPLE_FORMAL_TEMP_P (t) = 0; DECL_GIMPLE_FORMAL_TEMP_P (t) = 0;
...@@ -202,13 +199,12 @@ gimple_pop_condition (tree *pre_p) ...@@ -202,13 +199,12 @@ gimple_pop_condition (tree *pre_p)
{ {
int conds = --(gimplify_ctxp->conditions); int conds = --(gimplify_ctxp->conditions);
gcc_assert (conds >= 0);
if (conds == 0) if (conds == 0)
{ {
append_to_statement_list (gimplify_ctxp->conditional_cleanups, pre_p); append_to_statement_list (gimplify_ctxp->conditional_cleanups, pre_p);
gimplify_ctxp->conditional_cleanups = NULL_TREE; gimplify_ctxp->conditional_cleanups = NULL_TREE;
} }
else if (conds < 0)
abort ();
} }
/* A subroutine of append_to_statement_list{,_force}. */ /* A subroutine of append_to_statement_list{,_force}. */
...@@ -357,14 +353,11 @@ create_tmp_var (tree type, const char *prefix) ...@@ -357,14 +353,11 @@ create_tmp_var (tree type, const char *prefix)
{ {
tree tmp_var; tree tmp_var;
#if defined ENABLE_CHECKING
/* We don't allow types that are addressable (meaning we can't make copies), /* We don't allow types that are addressable (meaning we can't make copies),
incomplete, or of variable size. */ incomplete, or of variable size. */
if (TREE_ADDRESSABLE (type) gcc_assert (!TREE_ADDRESSABLE (type)
|| !COMPLETE_TYPE_P (type) && COMPLETE_TYPE_P (type)
|| TREE_CODE (TYPE_SIZE_UNIT (type)) != INTEGER_CST) && TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST);
abort ();
#endif
tmp_var = create_tmp_var_raw (type, prefix); tmp_var = create_tmp_var_raw (type, prefix);
gimple_add_tmp_var (tmp_var); gimple_add_tmp_var (tmp_var);
...@@ -517,8 +510,7 @@ declare_tmp_vars (tree vars, tree scope) ...@@ -517,8 +510,7 @@ declare_tmp_vars (tree vars, tree scope)
while (TREE_CODE (scope) == COMPOUND_EXPR) while (TREE_CODE (scope) == COMPOUND_EXPR)
scope = TREE_OPERAND (scope, 0); scope = TREE_OPERAND (scope, 0);
if (TREE_CODE (scope) != BIND_EXPR) gcc_assert (TREE_CODE (scope) == BIND_EXPR);
abort ();
temps = nreverse (last); temps = nreverse (last);
TREE_CHAIN (last) = BIND_EXPR_VARS (scope); TREE_CHAIN (last) = BIND_EXPR_VARS (scope);
...@@ -529,8 +521,7 @@ declare_tmp_vars (tree vars, tree scope) ...@@ -529,8 +521,7 @@ declare_tmp_vars (tree vars, tree scope)
void void
gimple_add_tmp_var (tree tmp) gimple_add_tmp_var (tree tmp)
{ {
if (TREE_CHAIN (tmp) || DECL_SEEN_IN_BIND_EXPR_P (tmp)) gcc_assert (!TREE_CHAIN (tmp) && !DECL_SEEN_IN_BIND_EXPR_P (tmp));
abort ();
DECL_CONTEXT (tmp) = current_function_decl; DECL_CONTEXT (tmp) = current_function_decl;
DECL_SEEN_IN_BIND_EXPR_P (tmp) = 1; DECL_SEEN_IN_BIND_EXPR_P (tmp) = 1;
...@@ -585,13 +576,10 @@ annotate_all_with_locus (tree *stmt_p, location_t locus) ...@@ -585,13 +576,10 @@ annotate_all_with_locus (tree *stmt_p, location_t locus)
{ {
tree t = tsi_stmt (i); tree t = tsi_stmt (i);
#ifdef ENABLE_CHECKING /* Assuming we've already been gimplified, we shouldn't
/* Assuming we've already been gimplified, we shouldn't see nested chaining constructs anymore. */
see nested chaining constructs anymore. */ gcc_assert (TREE_CODE (t) != STATEMENT_LIST
if (TREE_CODE (t) == STATEMENT_LIST && TREE_CODE (t) != COMPOUND_EXPR);
|| TREE_CODE (t) == COMPOUND_EXPR)
abort ();
#endif
annotate_one_with_locus (t, locus); annotate_one_with_locus (t, locus);
} }
...@@ -616,10 +604,11 @@ mostly_copy_tree_r (tree *tp, int *walk_subtrees, void *data) ...@@ -616,10 +604,11 @@ mostly_copy_tree_r (tree *tp, int *walk_subtrees, void *data)
uses. So just avert our eyes and cross our fingers. Silly Java. */ uses. So just avert our eyes and cross our fingers. Silly Java. */
|| code == BLOCK) || code == BLOCK)
*walk_subtrees = 0; *walk_subtrees = 0;
else if (code == BIND_EXPR)
abort ();
else else
copy_tree_r (tp, walk_subtrees, data); {
gcc_assert (code != BIND_EXPR);
copy_tree_r (tp, walk_subtrees, data);
}
return NULL_TREE; return NULL_TREE;
} }
...@@ -924,12 +913,10 @@ gimplify_return_expr (tree stmt, tree *pre_p) ...@@ -924,12 +913,10 @@ gimplify_return_expr (tree stmt, tree *pre_p)
if (TREE_CODE (result_decl) == INDIRECT_REF) if (TREE_CODE (result_decl) == INDIRECT_REF)
/* See through a return by reference. */ /* See through a return by reference. */
result_decl = TREE_OPERAND (result_decl, 0); result_decl = TREE_OPERAND (result_decl, 0);
#ifdef ENABLE_CHECKING
if ((TREE_CODE (ret_expr) != MODIFY_EXPR gcc_assert ((TREE_CODE (ret_expr) == MODIFY_EXPR
&& TREE_CODE (ret_expr) != INIT_EXPR) || TREE_CODE (ret_expr) == INIT_EXPR)
|| TREE_CODE (result_decl) != RESULT_DECL) && TREE_CODE (result_decl) == RESULT_DECL);
abort ();
#endif
} }
/* If aggregate_value_p is true, then we can return the bare RESULT_DECL. /* If aggregate_value_p is true, then we can return the bare RESULT_DECL.
...@@ -1150,8 +1137,7 @@ gimplify_switch_expr (tree *expr_p, tree *pre_p) ...@@ -1150,8 +1137,7 @@ gimplify_switch_expr (tree *expr_p, tree *pre_p)
/* If someone can be bothered to fill in the labels, they can /* If someone can be bothered to fill in the labels, they can
be bothered to null out the body too. */ be bothered to null out the body too. */
if (SWITCH_LABELS (switch_expr)) gcc_assert (!SWITCH_LABELS (switch_expr));
abort ();
saved_labels = gimplify_ctxp->case_labels; saved_labels = gimplify_ctxp->case_labels;
VARRAY_TREE_INIT (gimplify_ctxp->case_labels, 8, "case_labels"); VARRAY_TREE_INIT (gimplify_ctxp->case_labels, 8, "case_labels");
...@@ -1201,8 +1187,8 @@ gimplify_switch_expr (tree *expr_p, tree *pre_p) ...@@ -1201,8 +1187,8 @@ gimplify_switch_expr (tree *expr_p, tree *pre_p)
SWITCH_BODY (switch_expr) = NULL; SWITCH_BODY (switch_expr) = NULL;
} }
else if (!SWITCH_LABELS (switch_expr)) else
abort (); gcc_assert (SWITCH_LABELS (switch_expr));
return ret; return ret;
} }
...@@ -1211,10 +1197,9 @@ static enum gimplify_status ...@@ -1211,10 +1197,9 @@ static enum gimplify_status
gimplify_case_label_expr (tree *expr_p) gimplify_case_label_expr (tree *expr_p)
{ {
tree expr = *expr_p; tree expr = *expr_p;
if (gimplify_ctxp->case_labels)
VARRAY_PUSH_TREE (gimplify_ctxp->case_labels, expr); gcc_assert (gimplify_ctxp->case_labels);
else VARRAY_PUSH_TREE (gimplify_ctxp->case_labels, expr);
abort ();
*expr_p = build (LABEL_EXPR, void_type_node, CASE_LABEL (expr)); *expr_p = build (LABEL_EXPR, void_type_node, CASE_LABEL (expr));
return GS_ALL_DONE; return GS_ALL_DONE;
} }
...@@ -1248,10 +1233,7 @@ gimplify_exit_block_expr (tree *expr_p) ...@@ -1248,10 +1233,7 @@ gimplify_exit_block_expr (tree *expr_p)
/* First operand must be a LABELED_BLOCK_EXPR, which should /* First operand must be a LABELED_BLOCK_EXPR, which should
already be lowered (or partially lowered) when we get here. */ already be lowered (or partially lowered) when we get here. */
#if defined ENABLE_CHECKING gcc_assert (TREE_CODE (labeled_block) == LABELED_BLOCK_EXPR);
if (TREE_CODE (labeled_block) != LABELED_BLOCK_EXPR)
abort ();
#endif
label = LABELED_BLOCK_LABEL (labeled_block); label = LABELED_BLOCK_LABEL (labeled_block);
*expr_p = build1 (GOTO_EXPR, void_type_node, label); *expr_p = build1 (GOTO_EXPR, void_type_node, label);
...@@ -1325,8 +1307,7 @@ canonicalize_component_ref (tree *expr_p) ...@@ -1325,8 +1307,7 @@ canonicalize_component_ref (tree *expr_p)
tree expr = *expr_p; tree expr = *expr_p;
tree type; tree type;
if (TREE_CODE (expr) != COMPONENT_REF) gcc_assert (TREE_CODE (expr) == COMPONENT_REF);
abort ();
if (INTEGRAL_TYPE_P (TREE_TYPE (expr))) if (INTEGRAL_TYPE_P (TREE_TYPE (expr)))
type = TREE_TYPE (get_unwidened (expr, NULL_TREE)); type = TREE_TYPE (get_unwidened (expr, NULL_TREE));
...@@ -1485,10 +1466,7 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p, ...@@ -1485,10 +1466,7 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p,
p = &TREE_OPERAND (*p, 0)) p = &TREE_OPERAND (*p, 0))
VARRAY_PUSH_GENERIC_PTR_NOGC (stack, *p); VARRAY_PUSH_GENERIC_PTR_NOGC (stack, *p);
#if defined ENABLE_CHECKING gcc_assert (VARRAY_ACTIVE_SIZE (stack));
if (VARRAY_ACTIVE_SIZE (stack) == 0)
abort ();
#endif
/* Now STACK is a stack of pointers to all the refs we've walked through /* Now STACK is a stack of pointers to all the refs we've walked through
and P points to the innermost expression. and P points to the innermost expression.
...@@ -1651,13 +1629,8 @@ gimplify_self_mod_expr (tree *expr_p, tree *pre_p, tree *post_p, ...@@ -1651,13 +1629,8 @@ gimplify_self_mod_expr (tree *expr_p, tree *pre_p, tree *post_p,
code = TREE_CODE (*expr_p); code = TREE_CODE (*expr_p);
#if defined ENABLE_CHECKING gcc_assert (code == POSTINCREMENT_EXPR || code == POSTDECREMENT_EXPR
if (code != POSTINCREMENT_EXPR || code == PREINCREMENT_EXPR || code == PREDECREMENT_EXPR);
&& code != POSTDECREMENT_EXPR
&& code != PREINCREMENT_EXPR
&& code != PREDECREMENT_EXPR)
abort ();
#endif
/* Prefix or postfix? */ /* Prefix or postfix? */
if (code == POSTINCREMENT_EXPR || code == POSTDECREMENT_EXPR) if (code == POSTINCREMENT_EXPR || code == POSTDECREMENT_EXPR)
...@@ -1772,10 +1745,7 @@ gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value) ...@@ -1772,10 +1745,7 @@ gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value)
tree arglist; tree arglist;
enum gimplify_status ret; enum gimplify_status ret;
#if defined ENABLE_CHECKING gcc_assert (TREE_CODE (*expr_p) == CALL_EXPR);
if (TREE_CODE (*expr_p) != CALL_EXPR)
abort ();
#endif
/* For reliable diagnostics during inlining, it is necessary that /* For reliable diagnostics during inlining, it is necessary that
every call_expr be annotated with file and line. */ every call_expr be annotated with file and line. */
...@@ -2449,11 +2419,9 @@ gimplify_init_ctor_eval (tree object, tree list, tree *pre_p, bool cleared) ...@@ -2449,11 +2419,9 @@ gimplify_init_ctor_eval (tree object, tree list, tree *pre_p, bool cleared)
{ {
/* ??? Here's to hoping the front end fills in all of the indicies, /* ??? Here's to hoping the front end fills in all of the indicies,
so we don't have to figure out what's missing ourselves. */ so we don't have to figure out what's missing ourselves. */
if (!purpose) gcc_assert (purpose);
abort ();
/* ??? Need to handle this. */ /* ??? Need to handle this. */
if (TREE_CODE (purpose) == RANGE_EXPR) gcc_assert (TREE_CODE (purpose) != RANGE_EXPR);
abort ();
cref = build (ARRAY_REF, array_elt_type, unshare_expr (object), cref = build (ARRAY_REF, array_elt_type, unshare_expr (object),
purpose, NULL_TREE, NULL_TREE); purpose, NULL_TREE, NULL_TREE);
...@@ -2668,8 +2636,7 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p, ...@@ -2668,8 +2636,7 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
if (elt_list) if (elt_list)
{ {
i = TREE_VALUE (elt_list); i = TREE_VALUE (elt_list);
if (TREE_CHAIN (elt_list)) gcc_assert (!TREE_CHAIN (elt_list));
abort ();
} }
} }
if (r == NULL || i == NULL) if (r == NULL || i == NULL)
...@@ -2720,7 +2687,7 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p, ...@@ -2720,7 +2687,7 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
default: default:
/* So how did we get a CONSTRUCTOR for a scalar type? */ /* So how did we get a CONSTRUCTOR for a scalar type? */
abort (); gcc_unreachable ();
} }
if (ret == GS_ERROR) if (ret == GS_ERROR)
...@@ -2827,10 +2794,8 @@ gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value) ...@@ -2827,10 +2794,8 @@ gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value)
tree *to_p = &TREE_OPERAND (*expr_p, 0); tree *to_p = &TREE_OPERAND (*expr_p, 0);
enum gimplify_status ret = GS_UNHANDLED; enum gimplify_status ret = GS_UNHANDLED;
#if defined ENABLE_CHECKING gcc_assert (TREE_CODE (*expr_p) == MODIFY_EXPR
if (TREE_CODE (*expr_p) != MODIFY_EXPR && TREE_CODE (*expr_p) != INIT_EXPR) || TREE_CODE (*expr_p) == INIT_EXPR);
abort ();
#endif
/* The distinction between MODIFY_EXPR and INIT_EXPR is no longer useful. */ /* The distinction between MODIFY_EXPR and INIT_EXPR is no longer useful. */
if (TREE_CODE (*expr_p) == INIT_EXPR) if (TREE_CODE (*expr_p) == INIT_EXPR)
...@@ -2886,8 +2851,7 @@ gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value) ...@@ -2886,8 +2851,7 @@ gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value)
{ {
/* If we've somehow already got an SSA_NAME on the LHS, then /* If we've somehow already got an SSA_NAME on the LHS, then
we're probably modifying it twice. Not good. */ we're probably modifying it twice. Not good. */
if (TREE_CODE (*to_p) == SSA_NAME) gcc_assert (TREE_CODE (*to_p) != SSA_NAME);
abort ();
*to_p = make_ssa_name (*to_p, *expr_p); *to_p = make_ssa_name (*to_p, *expr_p);
} }
...@@ -3035,11 +2999,7 @@ gimplify_save_expr (tree *expr_p, tree *pre_p, tree *post_p) ...@@ -3035,11 +2999,7 @@ gimplify_save_expr (tree *expr_p, tree *pre_p, tree *post_p)
enum gimplify_status ret = GS_ALL_DONE; enum gimplify_status ret = GS_ALL_DONE;
tree val; tree val;
#if defined ENABLE_CHECKING gcc_assert (TREE_CODE (*expr_p) == SAVE_EXPR);
if (TREE_CODE (*expr_p) != SAVE_EXPR)
abort ();
#endif
val = TREE_OPERAND (*expr_p, 0); val = TREE_OPERAND (*expr_p, 0);
/* If the SAVE_EXPR has not been resolved, then evaluate it once. */ /* If the SAVE_EXPR has not been resolved, then evaluate it once. */
...@@ -3432,9 +3392,9 @@ gimplify_target_expr (tree *expr_p, tree *pre_p, tree *post_p) ...@@ -3432,9 +3392,9 @@ gimplify_target_expr (tree *expr_p, tree *pre_p, tree *post_p)
TREE_OPERAND (targ, 3) = init; TREE_OPERAND (targ, 3) = init;
TARGET_EXPR_INITIAL (targ) = NULL_TREE; TARGET_EXPR_INITIAL (targ) = NULL_TREE;
} }
else if (!DECL_SEEN_IN_BIND_EXPR_P (temp)) else
/* We should have expanded this before. */ /* We should have expanded this before. */
abort (); gcc_assert (DECL_SEEN_IN_BIND_EXPR_P (temp));
*expr_p = temp; *expr_p = temp;
return GS_OK; return GS_OK;
...@@ -3593,7 +3553,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, ...@@ -3593,7 +3553,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
break; break;
case TREE_LIST: case TREE_LIST:
abort (); gcc_unreachable ();
case COMPOUND_EXPR: case COMPOUND_EXPR:
ret = gimplify_compound_expr (expr_p, pre_p, fallback != fb_none); ret = gimplify_compound_expr (expr_p, pre_p, fallback != fb_none);
...@@ -3729,10 +3689,8 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, ...@@ -3729,10 +3689,8 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
case LABEL_EXPR: case LABEL_EXPR:
ret = GS_ALL_DONE; ret = GS_ALL_DONE;
#ifdef ENABLE_CHECKING gcc_assert (decl_function_context (LABEL_EXPR_LABEL (*expr_p))
if (decl_function_context (LABEL_EXPR_LABEL (*expr_p)) != current_function_decl) == current_function_decl);
abort ();
#endif
break; break;
case CASE_LABEL_EXPR: case CASE_LABEL_EXPR:
...@@ -3788,8 +3746,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, ...@@ -3788,8 +3746,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
case NON_LVALUE_EXPR: case NON_LVALUE_EXPR:
/* This should have been stripped above. */ /* This should have been stripped above. */
abort (); gcc_unreachable ();
break;
case ASM_EXPR: case ASM_EXPR:
ret = gimplify_asm_expr (expr_p, pre_p, post_p); ret = gimplify_asm_expr (expr_p, pre_p, post_p);
...@@ -3866,10 +3823,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, ...@@ -3866,10 +3823,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
&& decl_function_context (tmp) == current_function_decl && decl_function_context (tmp) == current_function_decl
&& !DECL_SEEN_IN_BIND_EXPR_P (tmp)) && !DECL_SEEN_IN_BIND_EXPR_P (tmp))
{ {
#ifdef ENABLE_CHECKING gcc_assert (errorcount || sorrycount);
if (!errorcount && !sorrycount)
abort ();
#endif
ret = GS_ERROR; ret = GS_ERROR;
break; break;
} }
...@@ -3892,49 +3846,58 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, ...@@ -3892,49 +3846,58 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
break; break;
default: default:
/* If this is a comparison of objects of aggregate type, handle switch (TREE_CODE_CLASS (TREE_CODE (*expr_p)))
it specially (by converting to a call to memcmp). It would be
nice to only have to do this for variable-sized objects, but
then we'd have to allow the same nest of reference nodes we
allow for MODIFY_EXPR and that's too complex. */
if (TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '<'
&& (AGGREGATE_TYPE_P (TREE_TYPE (TREE_OPERAND (*expr_p, 1)))))
ret = gimplify_variable_sized_compare (expr_p);
/* If *EXPR_P does not need to be special-cased, handle it
according to its class. */
else if (TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '1')
ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
post_p, is_gimple_val, fb_rvalue);
else if (TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '2'
|| TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '<'
|| TREE_CODE (*expr_p) == TRUTH_AND_EXPR
|| TREE_CODE (*expr_p) == TRUTH_OR_EXPR
|| TREE_CODE (*expr_p) == TRUTH_XOR_EXPR)
{ {
enum gimplify_status r0, r1; case '<':
/* If this is a comparison of objects of aggregate type,
r0 = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, handle it specially (by converting to a call to
post_p, is_gimple_val, fb_rvalue); memcmp). It would be nice to only have to do this
r1 = gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, for variable-sized objects, but then we'd have to
post_p, is_gimple_val, fb_rvalue); allow the same nest of reference nodes we allow for
MODIFY_EXPR and that's too complex. */
if (!AGGREGATE_TYPE_P (TREE_TYPE (TREE_OPERAND (*expr_p, 1))))
goto expr_2;
ret = gimplify_variable_sized_compare (expr_p);
break;
/* If *EXPR_P does not need to be special-cased, handle it
according to its class. */
case '1':
ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
post_p, is_gimple_val, fb_rvalue);
break;
ret = MIN (r0, r1); case '2':
} expr_2:
else if (TREE_CODE_CLASS (TREE_CODE (*expr_p)) == 'd' {
|| TREE_CODE_CLASS (TREE_CODE (*expr_p)) == 'c') enum gimplify_status r0, r1;
{
r0 = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
post_p, is_gimple_val, fb_rvalue);
r1 = gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p,
post_p, is_gimple_val, fb_rvalue);
ret = MIN (r0, r1);
break;
}
case 'd':
case 'c':
ret = GS_ALL_DONE; ret = GS_ALL_DONE;
break; goto dont_recalculate;
default:
gcc_assert (TREE_CODE (*expr_p) == TRUTH_AND_EXPR
|| TREE_CODE (*expr_p) == TRUTH_OR_EXPR
|| TREE_CODE (*expr_p) == TRUTH_XOR_EXPR);
goto expr_2;
} }
else
/* Fail if we don't know how to handle this tree code. */
abort ();
recalculate_side_effects (*expr_p); recalculate_side_effects (*expr_p);
dont_recalculate:
break; break;
} }
/* If we replaced *expr_p, gimplify again. */ /* If we replaced *expr_p, gimplify again. */
if (ret == GS_OK && (*expr_p == NULL || *expr_p == save_expr)) if (ret == GS_OK && (*expr_p == NULL || *expr_p == save_expr))
ret = GS_ALL_DONE; ret = GS_ALL_DONE;
...@@ -3950,12 +3913,9 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, ...@@ -3950,12 +3913,9 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
goto out; goto out;
} }
#ifdef ENABLE_CHECKING
/* This was only valid as a return value from the langhook, which /* This was only valid as a return value from the langhook, which
we handled. Make sure it doesn't escape from any other context. */ we handled. Make sure it doesn't escape from any other context. */
if (ret == GS_UNHANDLED) gcc_assert (ret != GS_UNHANDLED);
abort ();
#endif
if (fallback == fb_none && *expr_p && !is_gimple_stmt (*expr_p)) if (fallback == fb_none && *expr_p && !is_gimple_stmt (*expr_p))
{ {
...@@ -3969,21 +3929,26 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, ...@@ -3969,21 +3929,26 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
has side effects. Recurse through the operands to find it. */ has side effects. Recurse through the operands to find it. */
enum tree_code code = TREE_CODE (*expr_p); enum tree_code code = TREE_CODE (*expr_p);
if (code == COMPONENT_REF switch (code)
|| code == REALPART_EXPR || code == IMAGPART_EXPR)
gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
gimple_test_f, fallback);
else if (code == ARRAY_REF || code == ARRAY_RANGE_REF)
{ {
case COMPONENT_REF:
case REALPART_EXPR: case IMAGPART_EXPR:
gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
gimple_test_f, fallback);
break;
case ARRAY_REF: case ARRAY_RANGE_REF:
gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p, gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
gimple_test_f, fallback); gimple_test_f, fallback);
gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p, gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p,
gimple_test_f, fallback); gimple_test_f, fallback);
break;
default:
/* Anything else with side-effects must be converted to
a valid statement before we get here. */
gcc_unreachable ();
} }
else
/* Anything else with side-effects
must be converted to a valid statement before we get here. */
abort ();
*expr_p = NULL; *expr_p = NULL;
} }
...@@ -4049,10 +4014,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, ...@@ -4049,10 +4014,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
} }
else if ((fallback & fb_rvalue) && is_gimple_formal_tmp_rhs (*expr_p)) else if ((fallback & fb_rvalue) && is_gimple_formal_tmp_rhs (*expr_p))
{ {
#if defined ENABLE_CHECKING gcc_assert (!VOID_TYPE_P (TREE_TYPE (*expr_p)));
if (VOID_TYPE_P (TREE_TYPE (*expr_p)))
abort ();
#endif
/* An rvalue will do. Assign the gimplified expression into a new /* An rvalue will do. Assign the gimplified expression into a new
temporary TMP and replace the original expression with TMP. */ temporary TMP and replace the original expression with TMP. */
...@@ -4068,26 +4030,27 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, ...@@ -4068,26 +4030,27 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
if (TREE_CODE (*expr_p) != SSA_NAME) if (TREE_CODE (*expr_p) != SSA_NAME)
DECL_GIMPLE_FORMAL_TEMP_P (*expr_p) = 1; DECL_GIMPLE_FORMAL_TEMP_P (*expr_p) = 1;
} }
else if (fallback & fb_mayfail) else
{ {
/* If this is an asm statement, and the user asked for the impossible, #ifdef ENABLE_CHECKING
don't abort. Fail and let gimplify_asm_expr issue an error. */ if (!(fallback & fb_mayfail))
{
fprintf (stderr, "gimplification failed:\n");
print_generic_expr (stderr, *expr_p, 0);
debug_tree (*expr_p);
internal_error ("gimplification failed");
}
#endif
gcc_assert (fallback & fb_mayfail);
/* If this is an asm statement, and the user asked for the
impossible, don't abort. Fail and let gimplify_asm_expr
issue an error. */
ret = GS_ERROR; ret = GS_ERROR;
goto out; goto out;
} }
else
{
fprintf (stderr, "gimplification failed:\n");
print_generic_expr (stderr, *expr_p, 0);
debug_tree (*expr_p);
abort ();
}
#if defined ENABLE_CHECKING
/* Make sure the temporary matches our predicate. */ /* Make sure the temporary matches our predicate. */
if (!(*gimple_test_f) (*expr_p)) gcc_assert ((*gimple_test_f) (*expr_p));
abort ();
#endif
if (internal_post) if (internal_post)
{ {
...@@ -4212,8 +4175,7 @@ check_pointer_types_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED, ...@@ -4212,8 +4175,7 @@ check_pointer_types_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
otype = TREE_TYPE (t); otype = TREE_TYPE (t);
ptype = TREE_TYPE (TREE_OPERAND (t, 0)); ptype = TREE_TYPE (TREE_OPERAND (t, 0));
dtype = TREE_TYPE (ptype); dtype = TREE_TYPE (ptype);
if (!cpt_same_type (otype, dtype)) gcc_assert (cpt_same_type (otype, dtype));
abort ();
break; break;
case ADDR_EXPR: case ADDR_EXPR:
...@@ -4226,11 +4188,10 @@ check_pointer_types_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED, ...@@ -4226,11 +4188,10 @@ check_pointer_types_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
a pointer to the array type. We must allow this in order to a pointer to the array type. We must allow this in order to
properly represent assigning the address of an array in C into properly represent assigning the address of an array in C into
pointer to the element type. */ pointer to the element type. */
if (TREE_CODE (otype) == ARRAY_TYPE gcc_assert (TREE_CODE (otype) == ARRAY_TYPE
&& POINTER_TYPE_P (ptype) && POINTER_TYPE_P (ptype)
&& cpt_same_type (TREE_TYPE (otype), dtype)) && cpt_same_type (TREE_TYPE (otype), dtype));
break; break;
abort ();
} }
break; break;
...@@ -4373,8 +4334,7 @@ force_gimple_operand (tree expr, tree *stmts, bool simple, tree var) ...@@ -4373,8 +4334,7 @@ force_gimple_operand (tree expr, tree *stmts, bool simple, tree var)
ret = gimplify_expr (&expr, stmts, NULL, ret = gimplify_expr (&expr, stmts, NULL,
gimple_test_f, fb_rvalue); gimple_test_f, fb_rvalue);
if (ret == GS_ERROR) gcc_assert (ret != GS_ERROR);
abort ();
for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t)) for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t))
add_referenced_tmp_var (t); add_referenced_tmp_var (t);
......
...@@ -469,12 +469,12 @@ global_alloc (FILE *file) ...@@ -469,12 +469,12 @@ global_alloc (FILE *file)
&& (! current_function_has_nonlocal_label && (! current_function_has_nonlocal_label
|| REG_N_CALLS_CROSSED (i) == 0)) || 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]]; reg_allocno[i] = reg_allocno[reg_may_share[i]];
else else
reg_allocno[i] = max_allocno++; reg_allocno[i] = max_allocno++;
if (REG_LIVE_LENGTH (i) == 0) gcc_assert (REG_LIVE_LENGTH (i));
abort ();
} }
else else
reg_allocno[i] = -1; reg_allocno[i] = -1;
...@@ -1886,14 +1886,15 @@ build_insn_chain (rtx first) ...@@ -1886,14 +1886,15 @@ build_insn_chain (rtx first)
the previous real insn is a JUMP_INSN. */ the previous real insn is a JUMP_INSN. */
if (b == EXIT_BLOCK_PTR) if (b == EXIT_BLOCK_PTR)
{ {
for (first = NEXT_INSN (first) ; first; first = NEXT_INSN (first)) #ifdef ENABLE_CHECKING
if (INSN_P (first) for (first = NEXT_INSN (first); first; first = NEXT_INSN (first))
&& GET_CODE (PATTERN (first)) != USE gcc_assert (!INSN_P (first)
&& ! ((GET_CODE (PATTERN (first)) == ADDR_VEC || GET_CODE (PATTERN (first)) == USE
|| GET_CODE (PATTERN (first)) == ADDR_DIFF_VEC) || ((GET_CODE (PATTERN (first)) == ADDR_VEC
&& prev_real_insn (first) != 0 || GET_CODE (PATTERN (first)) == ADDR_DIFF_VEC)
&& JUMP_P (prev_real_insn (first)))) && prev_real_insn (first) != 0
abort (); && JUMP_P (prev_real_insn (first))));
#endif
break; break;
} }
} }
......
...@@ -398,14 +398,8 @@ clean_graph_dump_file (const char *base) ...@@ -398,14 +398,8 @@ clean_graph_dump_file (const char *base)
if (fp == NULL) if (fp == NULL)
fatal_error ("can't open %s: %m", buf); fatal_error ("can't open %s: %m", buf);
switch (graph_dump_format) gcc_assert (graph_dump_format == vcg);
{ fputs ("graph: {\nport_sharing: no\n", fp);
case vcg:
fputs ("graph: {\nport_sharing: no\n", fp);
break;
case no_graph:
abort ();
}
fclose (fp); fclose (fp);
} }
...@@ -426,15 +420,8 @@ finish_graph_dump_file (const char *base) ...@@ -426,15 +420,8 @@ finish_graph_dump_file (const char *base)
fp = fopen (buf, "a"); fp = fopen (buf, "a");
if (fp != NULL) if (fp != NULL)
{ {
switch (graph_dump_format) gcc_assert (graph_dump_format == vcg);
{ fputs ("}\n", fp);
case vcg:
fputs ("}\n", fp);
break;
case no_graph:
abort ();
}
fclose (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