This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[assert]: remaining c*.c files
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 07 Sep 2004 16:47:57 +0100
- Subject: [assert]: remaining c*.c files
- Organization: Codesourcery LLC
I've installed this patch for the remaining c*.c files.
booted and tested on i686-pc-linux-gnu.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2004-09-07 Nathan Sidwell <nathan@codesourcery.com>
* cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from,
cfgbuild.c, inside_basic_block_p, control_flow_insn_p,
make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert
or gcc_unreachable.
* cfg.c (clear_edges, initialize_bb_rbi, compact_blocks,
remove_edge, alloc_aux_for_blocks, free_aux_for_blocks,
alloc_aux_for_edges, free_aux_for_edges): Likewise.
* cfgcleanup.c (try_forward_edges,
merge_blocks_move_predecessor_nojumps,
merge_blocks_move_successor_nojumps): Likewise.
* cfgexpand.c (expand_gimple_cond_expr,
expand_gimple_tailcall): Likewise.
* cfghooks.c (duplicate_block): Likewise.
* cfglayout.c (record_effective_endpoints,
insn_locators_initialize, change_scope, fixup_reorder_chain,
verify_insn_chain, fixup_fallthru_exit_predecessor,
duplicate_insn_chain, cfg_layout_finalize): Likewise.
* cfgloopanal.c (check_irred): Likewise.
* cfgloop.c (superloop_at_depth, flow_loops_free,
flow_loop_entry_edges_find, flow_loops_find,
flow_loop_outside_edge_p, get_loop_body,
get_loop_body_in_dom_order, get_loop_body_in_bfs_order,
get_loop_exit_edges, num_loop_branches, cancel_loop,
verify_loop_structure): Likewise.
cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge,
duplicate_loop_to_header_edge, create_preheader,
create_loop_notes): Likewise.
* cfgrtl.c (delete_insn, try_redirect_by_replacing_jump,
edirect_branch_edge, force_nonfallthru_and_redirect,
rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion,
commit_edge_insertions, commit_edge_insertions_watch_calls,
purge_dead_edges, cfg_layout_redirect_edge_and_branch,
cfg_layout_redirect_edge_and_branch_force,
cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise.
* cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge,
cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info,
cgraph_varpool_node): Likewise.
* cgraphunit.c (cgraph_finalize_function,
cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output,
cgraph_expand_function, cgraph_remove_unreachable_nodes,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_expand_all_functions,
cgraph_build_static_cdtor): Likewise.
* combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx,
simplify_logical, distribute_notes, insn_cuid): Likewise.
* conflict.c (conflict_graph_add, print_conflict): Likewise.
* coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref,
coverage_checksum_string): Likewise.
* cse.c (make_new_qty, make_regs_eqv, insert, invalidate,
hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage,
cse_cc_succs, cse_condition_code_reg): Likewise.
* cselib.c (entry_and_rtx_equal_p, remove_useless_values,
rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx,
new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno,
cselib_record_set): Likewise.
Index: cfganal.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfganal.c,v
retrieving revision 1.47
diff -c -3 -p -r1.47 cfganal.c
*** cfganal.c 19 Aug 2004 00:32:41 -0000 1.47
--- cfganal.c 7 Sep 2004 12:30:42 -0000
*************** flow_depth_first_order_compute (int *dfs
*** 762,775 ****
free (stack);
sbitmap_free (visited);
! /* The number of nodes visited should not be greater than
! n_basic_blocks. */
! if (dfsnum > n_basic_blocks)
! abort ();
!
! /* There are some nodes left in the CFG that are unreachable. */
! if (dfsnum < n_basic_blocks)
! abort ();
return dfsnum;
}
--- 762,769 ----
free (stack);
sbitmap_free (visited);
! /* The number of nodes visited should be the number of blocks. */
! gcc_assert (dfsnum == n_basic_blocks);
return dfsnum;
}
*************** dfs_enumerate_from (basic_block bb, int
*** 1019,1026 ****
for (e = lbb->pred; e; e = e->pred_next)
if (!(e->src->flags & BB_VISITED) && predicate (e->src, data))
{
! if (tv == rslt_max)
! abort ();
rslt[tv++] = st[sp++] = e->src;
e->src->flags |= BB_VISITED;
}
--- 1013,1019 ----
for (e = lbb->pred; e; e = e->pred_next)
if (!(e->src->flags & BB_VISITED) && predicate (e->src, data))
{
! gcc_assert (tv != rslt_max);
rslt[tv++] = st[sp++] = e->src;
e->src->flags |= BB_VISITED;
}
*************** dfs_enumerate_from (basic_block bb, int
*** 1030,1037 ****
for (e = lbb->succ; e; e = e->succ_next)
if (!(e->dest->flags & BB_VISITED) && predicate (e->dest, data))
{
! if (tv == rslt_max)
! abort ();
rslt[tv++] = st[sp++] = e->dest;
e->dest->flags |= BB_VISITED;
}
--- 1023,1029 ----
for (e = lbb->succ; e; e = e->succ_next)
if (!(e->dest->flags & BB_VISITED) && predicate (e->dest, data))
{
! gcc_assert (tv != rslt_max);
rslt[tv++] = st[sp++] = e->dest;
e->dest->flags |= BB_VISITED;
}
Index: cfgbuild.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgbuild.c,v
retrieving revision 1.52
diff -c -3 -p -r1.52 cfgbuild.c
*** cfgbuild.c 25 Aug 2004 19:52:51 -0000 1.52
--- cfgbuild.c 7 Sep 2004 12:30:44 -0000
*************** inside_basic_block_p (rtx insn)
*** 83,89 ****
return false;
default:
! abort ();
}
}
--- 83,89 ----
return false;
default:
! gcc_unreachable ();
}
}
*************** control_flow_insn_p (rtx insn)
*** 131,137 ****
return false;
default:
! abort ();
}
}
--- 131,137 ----
return false;
default:
! gcc_unreachable ();
}
}
*************** count_basic_blocks (rtx f)
*** 183,190 ****
static void
make_label_edge (sbitmap *edge_cache, basic_block src, rtx label, int flags)
{
! if (!LABEL_P (label))
! abort ();
/* If the label was never emitted, this insn is junk, but avoid a
crash trying to refer to BLOCK_FOR_INSN (label). This can happen
--- 183,189 ----
static void
make_label_edge (sbitmap *edge_cache, basic_block src, rtx label, int flags)
{
! gcc_assert (LABEL_P (label));
/* If the label was never emitted, this insn is junk, but avoid a
crash trying to refer to BLOCK_FOR_INSN (label). This can happen
*************** make_edges (basic_block min, basic_block
*** 345,352 ****
/* Otherwise, we have a plain conditional or unconditional jump. */
else
{
! if (! JUMP_LABEL (insn))
! abort ();
make_label_edge (edge_cache, bb, JUMP_LABEL (insn), 0);
}
}
--- 344,350 ----
/* Otherwise, we have a plain conditional or unconditional jump. */
else
{
! gcc_assert (JUMP_LABEL (insn));
make_label_edge (edge_cache, bb, JUMP_LABEL (insn), 0);
}
}
*************** find_basic_blocks_1 (rtx f)
*** 490,496 ****
break;
default:
! abort ();
}
}
--- 488,494 ----
break;
default:
! gcc_unreachable ();
}
}
*************** find_basic_blocks_1 (rtx f)
*** 499,506 ****
else if (bb_note)
delete_insn (bb_note);
! if (last_basic_block != n_basic_blocks)
! abort ();
clear_aux_for_blocks ();
}
--- 497,503 ----
else if (bb_note)
delete_insn (bb_note);
! gcc_assert (last_basic_block == n_basic_blocks);
clear_aux_for_blocks ();
}
Index: cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfg.c,v
retrieving revision 1.64
diff -c -3 -p -r1.64 cfg.c
*** cfg.c 3 Sep 2004 22:38:33 -0000 1.64
--- cfg.c 7 Sep 2004 12:30:45 -0000
*************** clear_edges (void)
*** 173,180 ****
EXIT_BLOCK_PTR->pred = NULL;
ENTRY_BLOCK_PTR->succ = NULL;
! if (n_edges)
! abort ();
}
/* Allocate memory for basic_block. */
--- 173,179 ----
EXIT_BLOCK_PTR->pred = NULL;
ENTRY_BLOCK_PTR->succ = NULL;
! gcc_assert (!n_edges);
}
/* Allocate memory for basic_block. */
*************** free_rbi_pool (void)
*** 211,218 ****
void
initialize_bb_rbi (basic_block bb)
{
! if (bb->rbi)
! abort ();
bb->rbi = pool_alloc (rbi_pool);
memset (bb->rbi, 0, sizeof (struct reorder_block_def));
}
--- 210,216 ----
void
initialize_bb_rbi (basic_block bb)
{
! gcc_assert (!bb->rbi);
bb->rbi = pool_alloc (rbi_pool);
memset (bb->rbi, 0, sizeof (struct reorder_block_def));
}
*************** compact_blocks (void)
*** 252,259 ****
i++;
}
! if (i != n_basic_blocks)
! abort ();
for (; i < last_basic_block; i++)
BASIC_BLOCK (i) = NULL;
--- 250,256 ----
i++;
}
! gcc_assert (i == n_basic_blocks);
for (; i < last_basic_block; i++)
BASIC_BLOCK (i) = NULL;
*************** remove_edge (edge e)
*** 377,384 ****
for (tmp = src->succ; tmp && tmp != e; tmp = tmp->succ_next)
last_succ = tmp;
! if (!tmp)
! abort ();
if (last_succ)
last_succ->succ_next = e->succ_next;
else
--- 374,380 ----
for (tmp = src->succ; tmp && tmp != e; tmp = tmp->succ_next)
last_succ = tmp;
! gcc_assert (tmp);
if (last_succ)
last_succ->succ_next = e->succ_next;
else
*************** remove_edge (edge e)
*** 387,394 ****
for (tmp = dest->pred; tmp && tmp != e; tmp = tmp->pred_next)
last_pred = tmp;
! if (!tmp)
! abort ();
if (last_pred)
last_pred->pred_next = e->pred_next;
else
--- 383,389 ----
for (tmp = dest->pred; tmp && tmp != e; tmp = tmp->pred_next)
last_pred = tmp;
! gcc_assert (tmp);
if (last_pred)
last_pred->pred_next = e->pred_next;
else
*************** inline void
*** 696,703 ****
alloc_aux_for_block (basic_block bb, int size)
{
/* Verify that aux field is clear. */
! if (bb->aux || !first_block_aux_obj)
! abort ();
bb->aux = obstack_alloc (&block_aux_obstack, size);
memset (bb->aux, 0, size);
}
--- 691,697 ----
alloc_aux_for_block (basic_block bb, int size)
{
/* Verify that aux field is clear. */
! gcc_assert (!bb->aux && first_block_aux_obj);
bb->aux = obstack_alloc (&block_aux_obstack, size);
memset (bb->aux, 0, size);
}
*************** alloc_aux_for_blocks (int size)
*** 715,724 ****
gcc_obstack_init (&block_aux_obstack);
initialized = 1;
}
!
! /* Check whether AUX data are still allocated. */
! else if (first_block_aux_obj)
! abort ();
first_block_aux_obj = obstack_alloc (&block_aux_obstack, 0);
if (size)
{
--- 709,718 ----
gcc_obstack_init (&block_aux_obstack);
initialized = 1;
}
! else
! /* Check whether AUX data are still allocated. */
! gcc_assert (!first_block_aux_obj);
!
first_block_aux_obj = obstack_alloc (&block_aux_obstack, 0);
if (size)
{
*************** clear_aux_for_blocks (void)
*** 746,753 ****
void
free_aux_for_blocks (void)
{
! if (!first_block_aux_obj)
! abort ();
obstack_free (&block_aux_obstack, first_block_aux_obj);
first_block_aux_obj = NULL;
--- 740,746 ----
void
free_aux_for_blocks (void)
{
! gcc_assert (first_block_aux_obj);
obstack_free (&block_aux_obstack, first_block_aux_obj);
first_block_aux_obj = NULL;
*************** inline void
*** 761,768 ****
alloc_aux_for_edge (edge e, int size)
{
/* Verify that aux field is clear. */
! if (e->aux || !first_edge_aux_obj)
! abort ();
e->aux = obstack_alloc (&edge_aux_obstack, size);
memset (e->aux, 0, size);
}
--- 754,760 ----
alloc_aux_for_edge (edge e, int size)
{
/* Verify that aux field is clear. */
! gcc_assert (!e->aux && first_edge_aux_obj);
e->aux = obstack_alloc (&edge_aux_obstack, size);
memset (e->aux, 0, size);
}
*************** alloc_aux_for_edges (int size)
*** 780,789 ****
gcc_obstack_init (&edge_aux_obstack);
initialized = 1;
}
!
! /* Check whether AUX data are still allocated. */
! else if (first_edge_aux_obj)
! abort ();
first_edge_aux_obj = obstack_alloc (&edge_aux_obstack, 0);
if (size)
--- 772,780 ----
gcc_obstack_init (&edge_aux_obstack);
initialized = 1;
}
! else
! /* Check whether AUX data are still allocated. */
! gcc_assert (!first_edge_aux_obj);
first_edge_aux_obj = obstack_alloc (&edge_aux_obstack, 0);
if (size)
*************** clear_aux_for_edges (void)
*** 821,828 ****
void
free_aux_for_edges (void)
{
! if (!first_edge_aux_obj)
! abort ();
obstack_free (&edge_aux_obstack, first_edge_aux_obj);
first_edge_aux_obj = NULL;
--- 812,818 ----
void
free_aux_for_edges (void)
{
! gcc_assert (first_edge_aux_obj);
obstack_free (&edge_aux_obstack, first_edge_aux_obj);
first_edge_aux_obj = NULL;
Index: cfgcleanup.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgcleanup.c,v
retrieving revision 1.128
diff -c -3 -p -r1.128 cfgcleanup.c
*** cfgcleanup.c 30 Aug 2004 23:35:23 -0000 1.128
--- cfgcleanup.c 7 Sep 2004 12:30:51 -0000
*************** try_forward_edges (int mode, basic_block
*** 519,526 ****
if (t->dest == b)
break;
! if (nthreaded_edges >= n_basic_blocks)
! abort ();
threaded_edges[nthreaded_edges++] = t;
new_target = t->dest;
--- 519,525 ----
if (t->dest == b)
break;
! gcc_assert (nthreaded_edges < n_basic_blocks);
threaded_edges[nthreaded_edges++] = t;
new_target = t->dest;
*************** try_forward_edges (int mode, basic_block
*** 625,635 ****
{
edge e;
int prob;
! if (n >= nthreaded_edges)
! abort ();
t = threaded_edges [n++];
! if (t->src != first)
! abort ();
if (first->frequency)
prob = edge_frequency * REG_BR_PROB_BASE / first->frequency;
else
--- 624,633 ----
{
edge e;
int prob;
!
! gcc_assert (n < nthreaded_edges);
t = threaded_edges [n++];
! gcc_assert (t->src == first);
if (first->frequency)
prob = edge_frequency * REG_BR_PROB_BASE / first->frequency;
else
*************** static void
*** 686,691 ****
--- 684,690 ----
merge_blocks_move_predecessor_nojumps (basic_block a, basic_block b)
{
rtx barrier;
+ bool only_notes;
/* If we are partitioning hot/cold basic blocks, we don't want to
mess up unconditional or indirect jumps that cross between hot
*************** merge_blocks_move_predecessor_nojumps (b
*** 703,710 ****
return;
barrier = next_nonnote_insn (BB_END (a));
! if (!BARRIER_P (barrier))
! abort ();
delete_insn (barrier);
/* Move block and loop notes out of the chain so that we do not
--- 702,708 ----
return;
barrier = next_nonnote_insn (BB_END (a));
! gcc_assert (BARRIER_P (barrier));
delete_insn (barrier);
/* Move block and loop notes out of the chain so that we do not
*************** merge_blocks_move_predecessor_nojumps (b
*** 714,721 ****
and adjust the block trees appropriately. Even better would be to have
a tighter connection between block trees and rtl so that this is not
necessary. */
! if (squeeze_notes (&BB_HEAD (a), &BB_END (a)))
! abort ();
/* Scramble the insn chain. */
if (BB_END (a) != PREV_INSN (BB_HEAD (b)))
--- 712,719 ----
and adjust the block trees appropriately. Even better would be to have
a tighter connection between block trees and rtl so that this is not
necessary. */
! only_notes = squeeze_notes (&BB_HEAD (a), &BB_END (a));
! gcc_assert (!only_notes);
/* Scramble the insn chain. */
if (BB_END (a) != PREV_INSN (BB_HEAD (b)))
*************** merge_blocks_move_successor_nojumps (bas
*** 744,749 ****
--- 742,748 ----
{
rtx barrier, real_b_end;
rtx label, table;
+ bool only_notes;
/* If we are partitioning hot/cold basic blocks, we don't want to
mess up unconditional or indirect jumps that cross between hot
*************** merge_blocks_move_successor_nojumps (bas
*** 782,789 ****
and adjust the block trees appropriately. Even better would be to have
a tighter connection between block trees and rtl so that this is not
necessary. */
! if (squeeze_notes (&BB_HEAD (b), &BB_END (b)))
! abort ();
/* Scramble the insn chain. */
reorder_insns_nobb (BB_HEAD (b), BB_END (b), BB_END (a));
--- 781,789 ----
and adjust the block trees appropriately. Even better would be to have
a tighter connection between block trees and rtl so that this is not
necessary. */
! only_notes = squeeze_notes (&BB_HEAD (b), &BB_END (b));
! gcc_assert (!only_notes);
!
/* Scramble the insn chain. */
reorder_insns_nobb (BB_HEAD (b), BB_END (b), BB_END (a));
Index: cfgexpand.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgexpand.c,v
retrieving revision 2.21
diff -c -3 -p -r2.21 cfgexpand.c
*** cfgexpand.c 6 Sep 2004 10:07:44 -0000 2.21
--- cfgexpand.c 7 Sep 2004 12:30:52 -0000
*************** expand_gimple_cond_expr (basic_block bb,
*** 833,840 ****
jumpifnot (pred, label_rtx (GOTO_DESTINATION (else_exp)));
return NULL;
}
! if (TREE_CODE (then_exp) != GOTO_EXPR || TREE_CODE (else_exp) != GOTO_EXPR)
! abort ();
jumpif (pred, label_rtx (GOTO_DESTINATION (then_exp)));
last = get_last_insn ();
--- 833,840 ----
jumpifnot (pred, label_rtx (GOTO_DESTINATION (else_exp)));
return NULL;
}
! gcc_assert (TREE_CODE (then_exp) == GOTO_EXPR
! && TREE_CODE (else_exp) == GOTO_EXPR);
jumpif (pred, label_rtx (GOTO_DESTINATION (then_exp)));
last = get_last_insn ();
*************** expand_gimple_tailcall (basic_block bb,
*** 936,943 ****
after the sibcall (to perform the function return). These confuse the
find_sub_basic_blocks code, so we need to get rid of these. */
last = NEXT_INSN (last);
! if (!BARRIER_P (last))
! abort ();
*can_fallthru = false;
while (NEXT_INSN (last))
--- 936,942 ----
after the sibcall (to perform the function return). These confuse the
find_sub_basic_blocks code, so we need to get rid of these. */
last = NEXT_INSN (last);
! gcc_assert (BARRIER_P (last));
*can_fallthru = false;
while (NEXT_INSN (last))
Index: cfghooks.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfghooks.c,v
retrieving revision 1.12
diff -c -3 -p -r1.12 cfghooks.c
*** cfghooks.c 23 Jun 2004 04:09:46 -0000 1.12
--- cfghooks.c 7 Sep 2004 12:30:53 -0000
*************** duplicate_block (basic_block bb, edge e)
*** 678,688 ****
if (bb->count < new_count)
new_count = bb->count;
! if (!bb->pred)
! abort ();
#ifdef ENABLE_CHECKING
! if (!can_duplicate_block_p (bb))
! abort ();
#endif
new_bb = cfg_hooks->duplicate_block (bb);
--- 678,686 ----
if (bb->count < new_count)
new_count = bb->count;
! gcc_assert (bb->pred);
#ifdef ENABLE_CHECKING
! gcc_assert (can_duplicate_block_p (bb));
#endif
new_bb = cfg_hooks->duplicate_block (bb);
Index: cfglayout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfglayout.c,v
retrieving revision 1.73
diff -c -3 -p -r1.73 cfglayout.c
*** cfglayout.c 25 Aug 2004 19:52:52 -0000 1.73
--- cfglayout.c 7 Sep 2004 12:30:56 -0000
*************** record_effective_endpoints (void)
*** 199,206 ****
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK;
insn = NEXT_INSN (insn))
continue;
! if (!insn)
! abort (); /* No basic blocks at all? */
if (PREV_INSN (insn))
cfg_layout_function_header =
unlink_insn_chain (get_insns (), PREV_INSN (insn));
--- 199,207 ----
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK;
insn = NEXT_INSN (insn))
continue;
! /* No basic blocks at all? */
! gcc_assert (insn);
!
if (PREV_INSN (insn))
cfg_layout_function_header =
unlink_insn_chain (get_insns (), PREV_INSN (insn));
*************** insn_locators_initialize (void)
*** 273,293 ****
if (NOTE_P (insn))
{
! switch (NOTE_LINE_NUMBER (insn))
{
! case NOTE_INSN_BLOCK_BEG:
! case NOTE_INSN_BLOCK_END:
! abort ();
!
! default:
! if (NOTE_LINE_NUMBER (insn) > 0)
! {
! expanded_location xloc;
! NOTE_EXPANDED_LOCATION (xloc, insn);
! line_number = xloc.line;
! file_name = xloc.file;
! }
! break;
}
}
else
--- 274,287 ----
if (NOTE_P (insn))
{
! gcc_assert (NOTE_LINE_NUMBER (insn) != NOTE_INSN_BLOCK_BEG
! && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BLOCK_END);
! if (NOTE_LINE_NUMBER (insn) > 0)
{
! expanded_location xloc;
! NOTE_EXPANDED_LOCATION (xloc, insn);
! line_number = xloc.line;
! file_name = xloc.file;
}
}
else
*************** change_scope (rtx orig_insn, tree s1, tr
*** 377,384 ****
while (ts1 != ts2)
{
! if (ts1 == NULL || ts2 == NULL)
! abort ();
if (BLOCK_NUMBER (ts1) > BLOCK_NUMBER (ts2))
ts1 = BLOCK_SUPERCONTEXT (ts1);
else if (BLOCK_NUMBER (ts1) < BLOCK_NUMBER (ts2))
--- 371,377 ----
while (ts1 != ts2)
{
! gcc_assert (ts1 && ts2);
if (BLOCK_NUMBER (ts1) > BLOCK_NUMBER (ts2))
ts1 = BLOCK_SUPERCONTEXT (ts1);
else if (BLOCK_NUMBER (ts1) < BLOCK_NUMBER (ts2))
*************** fixup_reorder_chain (void)
*** 615,622 ****
}
}
! if (index != n_basic_blocks)
! abort ();
NEXT_INSN (insn) = cfg_layout_function_footer;
if (cfg_layout_function_footer)
--- 608,614 ----
}
}
! gcc_assert (index == n_basic_blocks);
NEXT_INSN (insn) = cfg_layout_function_footer;
if (cfg_layout_function_footer)
*************** fixup_reorder_chain (void)
*** 675,685 ****
{
rtx note;
edge e_fake;
e_fake = unchecked_make_edge (bb, e_fall->dest, 0);
! if (!redirect_jump (BB_END (bb), block_label (bb), 0))
! abort ();
note = find_reg_note (BB_END (bb), REG_BR_PROB, NULL_RTX);
if (note)
{
--- 667,680 ----
{
rtx note;
edge e_fake;
+ bool redirected;
e_fake = unchecked_make_edge (bb, e_fall->dest, 0);
! redirected = redirect_jump (BB_END (bb),
! block_label (bb), 0);
! gcc_assert (redirected);
!
note = find_reg_note (BB_END (bb), REG_BR_PROB, NULL_RTX);
if (note)
{
*************** fixup_reorder_chain (void)
*** 712,719 ****
{
e_fall->flags &= ~EDGE_FALLTHRU;
#ifdef ENABLE_CHECKING
! if (!could_fall_through (e_taken->src, e_taken->dest))
! abort ();
#endif
e_taken->flags |= EDGE_FALLTHRU;
update_br_prob_note (bb);
--- 707,714 ----
{
e_fall->flags &= ~EDGE_FALLTHRU;
#ifdef ENABLE_CHECKING
! gcc_assert (could_fall_through
! (e_taken->src, e_taken->dest));
#endif
e_taken->flags |= EDGE_FALLTHRU;
update_br_prob_note (bb);
*************** fixup_reorder_chain (void)
*** 736,766 ****
{
e_fall->flags &= ~EDGE_FALLTHRU;
#ifdef ENABLE_CHECKING
! if (!could_fall_through (e_taken->src, e_taken->dest))
! abort ();
#endif
e_taken->flags |= EDGE_FALLTHRU;
update_br_prob_note (bb);
continue;
}
}
- else if (returnjump_p (bb_end_insn))
- continue;
else
{
! /* Otherwise we have some switch or computed jump. In the
! 99% case, there should not have been a fallthru edge. */
! if (! e_fall)
continue;
-
- #ifdef CASE_DROPS_THROUGH
/* Except for VAX. Since we didn't have predication for the
tablejump, the fallthru block should not have moved. */
if (bb->rbi->next == e_fall->dest)
continue;
bb_end_insn = skip_insns_after_block (bb);
- #else
- abort ();
#endif
}
}
--- 731,760 ----
{
e_fall->flags &= ~EDGE_FALLTHRU;
#ifdef ENABLE_CHECKING
! gcc_assert (could_fall_through
! (e_taken->src, e_taken->dest));
#endif
e_taken->flags |= EDGE_FALLTHRU;
update_br_prob_note (bb);
continue;
}
}
else
{
! #ifndef CASE_DROPS_THROUGH
! /* Otherwise we have some return, switch or computed
! jump. In the 99% case, there should not have been a
! fallthru edge. */
! gcc_assert (returnjump_p (bb_end_insn) || !e_fall);
! continue;
! #else
! if (returnjump_p (bb_end_insn) || !e_fall)
continue;
/* Except for VAX. Since we didn't have predication for the
tablejump, the fallthru block should not have moved. */
if (bb->rbi->next == e_fall->dest)
continue;
bb_end_insn = skip_insns_after_block (bb);
#endif
}
}
*************** verify_insn_chain (void)
*** 903,922 ****
for (prevx = NULL, insn_cnt1 = 1, x = get_insns ();
x != 0;
prevx = x, insn_cnt1++, x = NEXT_INSN (x))
! if (PREV_INSN (x) != prevx)
! abort ();
! if (prevx != get_last_insn ())
! abort ();
for (nextx = NULL, insn_cnt2 = 1, x = get_last_insn ();
x != 0;
nextx = x, insn_cnt2++, x = PREV_INSN (x))
! if (NEXT_INSN (x) != nextx)
! abort ();
! if (insn_cnt1 != insn_cnt2)
! abort ();
}
/* If we have assembler epilogues, the block falling through to exit must
--- 897,912 ----
for (prevx = NULL, insn_cnt1 = 1, x = get_insns ();
x != 0;
prevx = x, insn_cnt1++, x = NEXT_INSN (x))
! gcc_assert (PREV_INSN (x) == prevx);
! gcc_assert (prevx == get_last_insn ());
for (nextx = NULL, insn_cnt2 = 1, x = get_last_insn ();
x != 0;
nextx = x, insn_cnt2++, x = PREV_INSN (x))
! gcc_assert (NEXT_INSN (x) == nextx);
! gcc_assert (insn_cnt1 == insn_cnt2);
}
/* If we have assembler epilogues, the block falling through to exit must
*************** fixup_fallthru_exit_predecessor (void)
*** 928,937 ****
edge e;
basic_block bb = NULL;
! /* This transformation is not valid before reload, because we might separate
! a call from the instruction that copies the return value. */
! if (! reload_completed)
! abort ();
for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next)
if (e->flags & EDGE_FALLTHRU)
--- 918,927 ----
edge e;
basic_block bb = NULL;
! /* This transformation is not valid before reload, because we might
! separate a call from the instruction that copies the return
! value. */
! gcc_assert (reload_completed);
for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next)
if (e->flags & EDGE_FALLTHRU)
*************** duplicate_insn_chain (rtx from, rtx to)
*** 1058,1088 ****
case NOTE_INSN_BASIC_BLOCK:
break;
- /* There is no purpose to duplicate prologue. */
- case NOTE_INSN_BLOCK_BEG:
- case NOTE_INSN_BLOCK_END:
- /* The BLOCK_BEG/BLOCK_END notes should be eliminated when BB
- reordering is in the progress. */
- case NOTE_INSN_EH_REGION_BEG:
- case NOTE_INSN_EH_REGION_END:
- /* Should never exist at BB duplication time. */
- abort ();
- break;
case NOTE_INSN_REPEATED_LINE_NUMBER:
case NOTE_INSN_UNLIKELY_EXECUTED_CODE:
emit_note_copy (insn);
break;
default:
! if (NOTE_LINE_NUMBER (insn) < 0)
! abort ();
/* It is possible that no_line_number is set and the note
won't be emitted. */
emit_note_copy (insn);
}
break;
default:
! abort ();
}
}
insn = NEXT_INSN (last);
--- 1048,1070 ----
case NOTE_INSN_BASIC_BLOCK:
break;
case NOTE_INSN_REPEATED_LINE_NUMBER:
case NOTE_INSN_UNLIKELY_EXECUTED_CODE:
emit_note_copy (insn);
break;
default:
! /* All other notes should have already been eliminated.
! */
! gcc_assert (NOTE_LINE_NUMBER (insn) >= 0);
!
/* It is possible that no_line_number is set and the note
won't be emitted. */
emit_note_copy (insn);
}
break;
default:
! gcc_unreachable ();
}
}
insn = NEXT_INSN (last);
*************** cfg_layout_finalize (void)
*** 1217,1223 ****
#ifdef ENABLE_CHECKING
verify_insn_chain ();
#endif
!
free_rbi_pool ();
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
bb->rbi = NULL;
--- 1199,1205 ----
#ifdef ENABLE_CHECKING
verify_insn_chain ();
#endif
!
free_rbi_pool ();
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
bb->rbi = NULL;
Index: cfgloopanal.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgloopanal.c,v
retrieving revision 1.26
diff -c -3 -p -r1.26 cfgloopanal.c
*** cfgloopanal.c 5 Sep 2004 09:25:24 -0000 1.26
--- cfgloopanal.c 7 Sep 2004 12:30:57 -0000
*************** check_irred (struct graph *g, struct edg
*** 208,215 ****
/* All edges should lead from a component with higher number to the
one with lower one. */
! if (g->vertices[e->src].component < g->vertices[e->dest].component)
! abort ();
if (g->vertices[e->src].component != g->vertices[e->dest].component)
return;
--- 208,214 ----
/* All edges should lead from a component with higher number to the
one with lower one. */
! gcc_assert (g->vertices[e->src].component >= g->vertices[e->dest].component);
if (g->vertices[e->src].component != g->vertices[e->dest].component)
return;
Index: cfgloop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgloop.c,v
retrieving revision 1.38
diff -c -3 -p -r1.38 cfgloop.c
*** cfgloop.c 4 Sep 2004 03:26:57 -0000 1.38
--- cfgloop.c 7 Sep 2004 12:30:59 -0000
*************** flow_loop_nested_p (const struct loop *o
*** 107,114 ****
struct loop *
superloop_at_depth (struct loop *loop, unsigned depth)
{
! if (depth > (unsigned) loop->depth)
! abort ();
if (depth == (unsigned) loop->depth)
return loop;
--- 107,113 ----
struct loop *
superloop_at_depth (struct loop *loop, unsigned depth)
{
! gcc_assert (depth <= (unsigned) loop->depth);
if (depth == (unsigned) loop->depth)
return loop;
*************** flow_loops_free (struct loops *loops)
*** 213,220 ****
{
unsigned i;
! if (! loops->num)
! abort ();
/* Free the loop descriptors. */
for (i = 0; i < loops->num; i++)
--- 212,218 ----
{
unsigned i;
! gcc_assert (loops->num);
/* Free the loop descriptors. */
for (i = 0; i < loops->num; i++)
*************** flow_loop_entry_edges_find (struct loop
*** 253,260 ****
num_entries++;
}
! if (! num_entries)
! abort ();
loop->entry_edges = xmalloc (num_entries * sizeof (edge *));
--- 251,257 ----
num_entries++;
}
! gcc_assert (num_entries);
loop->entry_edges = xmalloc (num_entries * sizeof (edge *));
*************** flow_loops_find (struct loops *loops, in
*** 794,801 ****
/* This function cannot be repeatedly called with different
flags to build up the loop information. The loop tree
must always be built if this function is called. */
! if (! (flags & LOOP_TREE))
! abort ();
memset (loops, 0, sizeof *loops);
--- 791,797 ----
/* This function cannot be repeatedly called with different
flags to build up the loop information. The loop tree
must always be built if this function is called. */
! gcc_assert (flags & LOOP_TREE);
memset (loops, 0, sizeof *loops);
*************** flow_loops_find (struct loops *loops, in
*** 837,844 ****
{
basic_block latch = e->src;
! if (e->flags & EDGE_ABNORMAL)
! abort ();
/* Look for back edges where a predecessor is dominated
by this block. A natural loop has a single entry
--- 833,839 ----
{
basic_block latch = e->src;
! gcc_assert (!(e->flags & EDGE_ABNORMAL));
/* Look for back edges where a predecessor is dominated
by this block. A natural loop has a single entry
*************** flow_loops_find (struct loops *loops, in
*** 849,856 ****
&& dominated_by_p (CDI_DOMINATORS, latch, header))
{
/* Shared headers should be eliminated by now. */
! if (more_latches)
! abort ();
more_latches = 1;
SET_BIT (headers, header->index);
num_loops++;
--- 844,850 ----
&& dominated_by_p (CDI_DOMINATORS, latch, header))
{
/* Shared headers should be eliminated by now. */
! gcc_assert (!more_latches);
more_latches = 1;
SET_BIT (headers, header->index);
num_loops++;
*************** flow_bb_inside_loop_p (const struct loop
*** 984,991 ****
bool
flow_loop_outside_edge_p (const struct loop *loop, edge e)
{
! if (e->dest != loop->header)
! abort ();
return !flow_bb_inside_loop_p (loop, e->src);
}
--- 978,984 ----
bool
flow_loop_outside_edge_p (const struct loop *loop, edge e)
{
! gcc_assert (e->dest == loop->header);
return !flow_bb_inside_loop_p (loop, e->src);
}
*************** get_loop_body (const struct loop *loop)
*** 1005,1012 ****
basic_block *tovisit, bb;
unsigned tv = 0;
! if (!loop->num_nodes)
! abort ();
tovisit = xcalloc (loop->num_nodes, sizeof (basic_block));
tovisit[tv++] = loop->header;
--- 998,1004 ----
basic_block *tovisit, bb;
unsigned tv = 0;
! gcc_assert (loop->num_nodes);
tovisit = xcalloc (loop->num_nodes, sizeof (basic_block));
tovisit[tv++] = loop->header;
*************** get_loop_body (const struct loop *loop)
*** 1014,1021 ****
if (loop->latch == EXIT_BLOCK_PTR)
{
/* There may be blocks unreachable from EXIT_BLOCK. */
! if (loop->num_nodes != (unsigned) n_basic_blocks + 2)
! abort ();
FOR_EACH_BB (bb)
tovisit[tv++] = bb;
tovisit[tv++] = EXIT_BLOCK_PTR;
--- 1006,1012 ----
if (loop->latch == EXIT_BLOCK_PTR)
{
/* There may be blocks unreachable from EXIT_BLOCK. */
! gcc_assert (loop->num_nodes == (unsigned) n_basic_blocks + 2);
FOR_EACH_BB (bb)
tovisit[tv++] = bb;
tovisit[tv++] = EXIT_BLOCK_PTR;
*************** get_loop_body (const struct loop *loop)
*** 1027,1034 ****
loop->header) + 1;
}
! if (tv != loop->num_nodes)
! abort ();
return tovisit;
}
--- 1018,1024 ----
loop->header) + 1;
}
! gcc_assert (tv == loop->num_nodes);
return tovisit;
}
*************** get_loop_body_in_dom_order (const struct
*** 1071,1089 ****
basic_block *tovisit;
int tv;
! if (!loop->num_nodes)
! abort ();
tovisit = xcalloc (loop->num_nodes, sizeof (basic_block));
! if (loop->latch == EXIT_BLOCK_PTR)
! abort ();
tv = 0;
fill_sons_in_loop (loop, loop->header, tovisit, &tv);
! if (tv != (int) loop->num_nodes)
! abort ();
return tovisit;
}
--- 1061,1076 ----
basic_block *tovisit;
int tv;
! gcc_assert (loop->num_nodes);
tovisit = xcalloc (loop->num_nodes, sizeof (basic_block));
! gcc_assert (loop->latch != EXIT_BLOCK_PTR);
tv = 0;
fill_sons_in_loop (loop, loop->header, tovisit, &tv);
! gcc_assert (tv == (int) loop->num_nodes);
return tovisit;
}
*************** get_loop_body_in_bfs_order (const struct
*** 1099,1109 ****
unsigned int i = 0;
unsigned int vc = 1;
! if (!loop->num_nodes)
! abort ();
!
! if (loop->latch == EXIT_BLOCK_PTR)
! abort ();
blocks = xcalloc (loop->num_nodes, sizeof (basic_block));
visited = BITMAP_XMALLOC ();
--- 1086,1093 ----
unsigned int i = 0;
unsigned int vc = 1;
! gcc_assert (loop->num_nodes);
! gcc_assert (loop->latch != EXIT_BLOCK_PTR);
blocks = xcalloc (loop->num_nodes, sizeof (basic_block));
visited = BITMAP_XMALLOC ();
*************** get_loop_body_in_bfs_order (const struct
*** 1132,1139 ****
}
}
! if (i < vc)
! abort ();
bb = blocks[vc++];
}
--- 1116,1122 ----
}
}
! gcc_assert (i >= vc);
bb = blocks[vc++];
}
*************** get_loop_exit_edges (const struct loop *
*** 1150,1157 ****
unsigned i, n;
basic_block * body;
! if (loop->latch == EXIT_BLOCK_PTR)
! abort ();
body = get_loop_body (loop);
n = 0;
--- 1133,1139 ----
unsigned i, n;
basic_block * body;
! gcc_assert (loop->latch != EXIT_BLOCK_PTR);
body = get_loop_body (loop);
n = 0;
*************** num_loop_branches (const struct loop *lo
*** 1179,1186 ****
unsigned i, n;
basic_block * body;
! if (loop->latch == EXIT_BLOCK_PTR)
! abort ();
body = get_loop_body (loop);
n = 0;
--- 1161,1167 ----
unsigned i, n;
basic_block * body;
! gcc_assert (loop->latch != EXIT_BLOCK_PTR);
body = get_loop_body (loop);
n = 0;
*************** cancel_loop (struct loops *loops, struct
*** 1246,1253 ****
basic_block *bbs;
unsigned i;
! if (loop->inner)
! abort ();
/* Move blocks up one level (they should be removed as soon as possible). */
bbs = get_loop_body (loop);
--- 1227,1233 ----
basic_block *bbs;
unsigned i;
! gcc_assert (!loop->inner);
/* Move blocks up one level (they should be removed as soon as possible). */
bbs = get_loop_body (loop);
*************** verify_loop_structure (struct loops *loo
*** 1492,1499 ****
}
}
! if (err)
! abort ();
free (sizes);
}
--- 1472,1478 ----
}
}
! gcc_assert (!err);
free (sizes);
}
Index: cfgloopmanip.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgloopmanip.c,v
retrieving revision 1.28
diff -c -3 -p -r1.28 cfgloopmanip.c
*** cfgloopmanip.c 24 Aug 2004 20:48:14 -0000 1.28
--- cfgloopmanip.c 7 Sep 2004 12:31:02 -0000
*************** remove_bbs (basic_block *bbs, int nbbs)
*** 98,105 ****
static int
find_path (edge e, basic_block **bbs)
{
! if (e->dest->pred->pred_next)
! abort ();
/* Find bbs in the path. */
*bbs = xcalloc (n_basic_blocks, sizeof (basic_block));
--- 98,104 ----
static int
find_path (edge e, basic_block **bbs)
{
! gcc_assert (!e->dest->pred->pred_next);
/* Find bbs in the path. */
*bbs = xcalloc (n_basic_blocks, sizeof (basic_block));
*************** remove_path (struct loops *loops, edge e
*** 323,328 ****
--- 322,328 ----
basic_block *rem_bbs, *bord_bbs, *dom_bbs, from, bb;
int i, nrem, n_bord_bbs, n_dom_bbs;
sbitmap seen;
+ bool deleted;
if (!loop_delete_branch_edge (e, 0))
return false;
*************** remove_path (struct loops *loops, edge e
*** 367,374 ****
/* Remove the path. */
from = e->src;
! if (!loop_delete_branch_edge (e, 1))
! abort ();
dom_bbs = xcalloc (n_basic_blocks, sizeof (basic_block));
/* Cancel loops contained in the path. */
--- 367,374 ----
/* Remove the path. */
from = e->src;
! deleted = loop_delete_branch_edge (e, 1);
! gcc_assert (deleted);
dom_bbs = xcalloc (n_basic_blocks, sizeof (basic_block));
/* Cancel loops contained in the path. */
*************** static bool
*** 765,811 ****
loop_delete_branch_edge (edge e, int really_delete)
{
basic_block src = e->src;
int irr;
edge snd;
! if (src->succ->succ_next)
! {
! basic_block newdest;
!
! /* Cannot handle more than two exit edges. */
! if (src->succ->succ_next->succ_next)
! return false;
! /* And it must be just a simple branch. */
! if (!any_condjump_p (BB_END (src)))
! return false;
!
! snd = e == src->succ ? src->succ->succ_next : src->succ;
! newdest = snd->dest;
! if (newdest == EXIT_BLOCK_PTR)
! return false;
!
! /* Hopefully the above conditions should suffice. */
! if (!really_delete)
! return true;
! /* Redirecting behaves wrongly wrto this flag. */
! irr = snd->flags & EDGE_IRREDUCIBLE_LOOP;
! if (!redirect_edge_and_branch (e, newdest))
! return false;
! src->succ->flags &= ~EDGE_IRREDUCIBLE_LOOP;
! src->succ->flags |= irr;
! return true;
! }
! else
! {
! /* Cannot happen -- we are using this only to remove an edge
! from branch. */
! abort ();
! }
! return false; /* To avoid warning, cannot get here. */
}
/* Check whether LOOP's body can be duplicated. */
--- 765,801 ----
loop_delete_branch_edge (edge e, int really_delete)
{
basic_block src = e->src;
+ basic_block newdest;
int irr;
edge snd;
! gcc_assert (src->succ->succ_next);
!
! /* Cannot handle more than two exit edges. */
! if (src->succ->succ_next->succ_next)
! return false;
! /* And it must be just a simple branch. */
! if (!any_condjump_p (BB_END (src)))
! return false;
! snd = e == src->succ ? src->succ->succ_next : src->succ;
! newdest = snd->dest;
! if (newdest == EXIT_BLOCK_PTR)
! return false;
! /* Hopefully the above conditions should suffice. */
! if (!really_delete)
! return true;
! /* Redirecting behaves wrongly wrto this flag. */
! irr = snd->flags & EDGE_IRREDUCIBLE_LOOP;
! if (!redirect_edge_and_branch (e, newdest))
! return false;
! src->succ->flags &= ~EDGE_IRREDUCIBLE_LOOP;
! src->succ->flags |= irr;
!
! return true;
}
/* Check whether LOOP's body can be duplicated. */
*************** duplicate_loop_to_header_edge (struct lo
*** 880,897 ****
int prob_pass_thru, prob_pass_wont_exit, prob_pass_main;
int add_irreducible_flag;
! if (e->dest != loop->header)
! abort ();
! if (ndupl <= 0)
! abort ();
if (orig)
{
/* Orig must be edge out of the loop. */
! if (!flow_bb_inside_loop_p (loop, orig->src))
! abort ();
! if (flow_bb_inside_loop_p (loop, orig->dest))
! abort ();
}
bbs = get_loop_body (loop);
--- 870,883 ----
int prob_pass_thru, prob_pass_wont_exit, prob_pass_main;
int add_irreducible_flag;
! gcc_assert (e->dest == loop->header);
! gcc_assert (ndupl > 0);
if (orig)
{
/* Orig must be edge out of the loop. */
! gcc_assert (flow_bb_inside_loop_p (loop, orig->src));
! gcc_assert (!flow_bb_inside_loop_p (loop, orig->dest));
}
bbs = get_loop_body (loop);
*************** duplicate_loop_to_header_edge (struct lo
*** 907,914 ****
/* In case we are doing loop peeling and the loop is in the middle of
irreducible region, the peeled copies will be inside it too. */
add_irreducible_flag = e->flags & EDGE_IRREDUCIBLE_LOOP;
! if (is_latch && add_irreducible_flag)
! abort ();
/* Find edge from latch. */
latch_edge = loop_latch_edge (loop);
--- 893,899 ----
/* In case we are doing loop peeling and the loop is in the middle of
irreducible region, the peeled copies will be inside it too. */
add_irreducible_flag = e->flags & EDGE_IRREDUCIBLE_LOOP;
! gcc_assert (!is_latch || !add_irreducible_flag);
/* Find edge from latch. */
latch_edge = loop_latch_edge (loop);
*************** duplicate_loop_to_header_edge (struct lo
*** 960,970 ****
scale_act = REG_BR_PROB_BASE - prob_pass_thru;
}
for (i = 0; i < ndupl; i++)
! if (scale_step[i] < 0 || scale_step[i] > REG_BR_PROB_BASE)
! abort ();
! if (scale_main < 0 || scale_main > REG_BR_PROB_BASE
! || scale_act < 0 || scale_act > REG_BR_PROB_BASE)
! abort ();
}
/* Loop the new bbs will belong to. */
--- 945,953 ----
scale_act = REG_BR_PROB_BASE - prob_pass_thru;
}
for (i = 0; i < ndupl; i++)
! gcc_assert (scale_step[i] >= 0 && scale_step[i] <= REG_BR_PROB_BASE);
! gcc_assert (scale_main >= 0 && scale_main <= REG_BR_PROB_BASE
! && scale_act >= 0 && scale_act <= REG_BR_PROB_BASE);
}
/* Loop the new bbs will belong to. */
*************** create_preheader (struct loop *loop, int
*** 1154,1161 ****
irred |= (e->flags & EDGE_IRREDUCIBLE_LOOP) != 0;
nentry++;
}
! if (!nentry)
! abort ();
if (nentry == 1)
{
for (e = loop->header->pred; e->src == loop->latch; e = e->pred_next);
--- 1137,1143 ----
irred |= (e->flags & EDGE_IRREDUCIBLE_LOOP) != 0;
nentry++;
}
! gcc_assert (nentry);
if (nentry == 1)
{
for (e = loop->header->pred; e->src == loop->latch; e = e->pred_next);
*************** create_loop_notes (void)
*** 1285,1293 ****
#ifdef ENABLE_CHECKING
/* Verify that there really are no loop notes. */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
! if (NOTE_P (insn)
! && NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
! abort ();
#endif
flow_loops_find (&loops, LOOP_TREE);
--- 1267,1274 ----
#ifdef ENABLE_CHECKING
/* Verify that there really are no loop notes. */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
! gcc_assert (!NOTE_P (insn) ||
! NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_BEG);
#endif
flow_loops_find (&loops, LOOP_TREE);
*************** create_loop_notes (void)
*** 1335,1342 ****
&& onlyjump_p (insn))
{
pbb = BLOCK_FOR_INSN (insn);
! if (!pbb || !pbb->succ || pbb->succ->succ_next)
! abort ();
if (!flow_bb_inside_loop_p (loop, pbb->succ->dest))
insn = BB_HEAD (first[loop->num]);
--- 1316,1322 ----
&& onlyjump_p (insn))
{
pbb = BLOCK_FOR_INSN (insn);
! gcc_assert (pbb && pbb->succ && !pbb->succ->succ_next);
if (!flow_bb_inside_loop_p (loop, pbb->succ->dest))
insn = BB_HEAD (first[loop->num]);
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.131
diff -c -3 -p -r1.131 cfgrtl.c
*** cfgrtl.c 25 Aug 2004 19:52:52 -0000 1.131
--- cfgrtl.c 7 Sep 2004 12:31:08 -0000
*************** delete_insn (rtx insn)
*** 139,146 ****
if (really_delete)
{
/* If this insn has already been deleted, something is very wrong. */
! if (INSN_DELETED_P (insn))
! abort ();
remove_insn (insn);
INSN_DELETED_P (insn) = 1;
}
--- 139,145 ----
if (really_delete)
{
/* If this insn has already been deleted, something is very wrong. */
! gcc_assert (!INSN_DELETED_P (insn));
remove_insn (insn);
INSN_DELETED_P (insn) = 1;
}
*************** try_redirect_by_replacing_jump (edge e,
*** 754,762 ****
INSN_UID (insn), e->dest->index, target->index);
if (!redirect_jump (insn, block_label (target), 0))
{
! if (target == EXIT_BLOCK_PTR)
! return NULL;
! abort ();
}
}
--- 753,760 ----
INSN_UID (insn), e->dest->index, target->index);
if (!redirect_jump (insn, block_label (target), 0))
{
! gcc_assert (target == EXIT_BLOCK_PTR);
! return NULL;
}
}
*************** redirect_branch_edge (edge e, basic_bloc
*** 923,939 ****
return NULL;
/* If the insn doesn't go where we think, we're confused. */
! if (JUMP_LABEL (insn) != old_label)
! abort ();
/* If the substitution doesn't succeed, die. This can happen
if the back end emitted unrecognizable instructions or if
target is exit block on some arches. */
if (!redirect_jump (insn, block_label (target), 0))
{
! if (target == EXIT_BLOCK_PTR)
! return NULL;
! abort ();
}
}
--- 921,935 ----
return NULL;
/* If the insn doesn't go where we think, we're confused. */
! gcc_assert (JUMP_LABEL (insn) == old_label);
/* If the substitution doesn't succeed, die. This can happen
if the back end emitted unrecognizable instructions or if
target is exit block on some arches. */
if (!redirect_jump (insn, block_label (target), 0))
{
! gcc_assert (target == EXIT_BLOCK_PTR);
! return NULL;
}
}
*************** force_nonfallthru_and_redirect (edge e,
*** 1006,1014 ****
{
rtx note;
edge b = unchecked_make_edge (e->src, target, 0);
! if (!redirect_jump (BB_END (e->src), block_label (target), 0))
! abort ();
note = find_reg_note (BB_END (e->src), REG_BR_PROB, NULL_RTX);
if (note)
{
--- 1002,1012 ----
{
rtx note;
edge b = unchecked_make_edge (e->src, target, 0);
+ bool redirected;
! redirected = redirect_jump (BB_END (e->src), block_label (target), 0);
! gcc_assert (redirected);
!
note = find_reg_note (BB_END (e->src), REG_BR_PROB, NULL_RTX);
if (note)
{
*************** force_nonfallthru_and_redirect (edge e,
*** 1032,1063 ****
We can't redirect abnormal edge, but we still can split the fallthru
one and create separate abnormal edge to original destination.
This allows bb-reorder to make such edge non-fallthru. */
! if (e->dest != target)
! abort ();
abnormal_edge_flags = e->flags & ~(EDGE_FALLTHRU | EDGE_CAN_FALLTHRU);
e->flags &= EDGE_FALLTHRU | EDGE_CAN_FALLTHRU;
}
! else if (!(e->flags & EDGE_FALLTHRU))
! abort ();
! else if (e->src == ENTRY_BLOCK_PTR)
! {
! /* We can't redirect the entry block. Create an empty block at the
! start of the function which we use to add the new jump. */
! edge *pe1;
! basic_block bb = create_basic_block (BB_HEAD (e->dest), NULL, ENTRY_BLOCK_PTR);
!
! /* Change the existing edge's source to be the new block, and add
! a new edge from the entry block to the new block. */
! e->src = bb;
! for (pe1 = &ENTRY_BLOCK_PTR->succ; *pe1; pe1 = &(*pe1)->succ_next)
! if (*pe1 == e)
! {
! *pe1 = e->succ_next;
! break;
! }
! e->succ_next = 0;
! bb->succ = e;
! make_single_succ_edge (ENTRY_BLOCK_PTR, bb, EDGE_FALLTHRU);
}
if (e->src->succ->succ_next || abnormal_edge_flags)
--- 1030,1064 ----
We can't redirect abnormal edge, but we still can split the fallthru
one and create separate abnormal edge to original destination.
This allows bb-reorder to make such edge non-fallthru. */
! gcc_assert (e->dest == target);
abnormal_edge_flags = e->flags & ~(EDGE_FALLTHRU | EDGE_CAN_FALLTHRU);
e->flags &= EDGE_FALLTHRU | EDGE_CAN_FALLTHRU;
}
! else
! {
! gcc_assert (e->flags & EDGE_FALLTHRU);
! if (e->src == ENTRY_BLOCK_PTR)
! {
! /* We can't redirect the entry block. Create an empty block
! at the start of the function which we use to add the new
! jump. */
! edge *pe1;
! basic_block bb
! = create_basic_block (BB_HEAD (e->dest), NULL, ENTRY_BLOCK_PTR);
!
! /* Change the existing edge's source to be the new block, and add
! a new edge from the entry block to the new block. */
! e->src = bb;
! for (pe1 = &ENTRY_BLOCK_PTR->succ; *pe1; pe1 = &(*pe1)->succ_next)
! if (*pe1 == e)
! {
! *pe1 = e->succ_next;
! break;
! }
! e->succ_next = 0;
! bb->succ = e;
! make_single_succ_edge (ENTRY_BLOCK_PTR, bb, EDGE_FALLTHRU);
! }
}
if (e->src->succ->succ_next || abnormal_edge_flags)
*************** force_nonfallthru_and_redirect (edge e,
*** 1138,1144 ****
#ifdef HAVE_return
emit_jump_insn_after (gen_return (), BB_END (jump_block));
#else
! abort ();
#endif
}
else
--- 1139,1145 ----
#ifdef HAVE_return
emit_jump_insn_after (gen_return (), BB_END (jump_block));
#else
! gcc_unreachable ();
#endif
}
else
*************** rtl_split_edge (edge edge_in)
*** 1295,1302 ****
rtx before;
/* Abnormal edges cannot be split. */
! if ((edge_in->flags & EDGE_ABNORMAL) != 0)
! abort ();
/* We are going to place the new block in front of edge destination.
Avoid existence of fallthru predecessors. */
--- 1296,1302 ----
rtx before;
/* Abnormal edges cannot be split. */
! gcc_assert (!(edge_in->flags & EDGE_ABNORMAL));
/* We are going to place the new block in front of edge destination.
Avoid existence of fallthru predecessors. */
*************** rtl_split_edge (edge edge_in)
*** 1378,1385 ****
jump instruction to target our new block. */
if ((edge_in->flags & EDGE_FALLTHRU) == 0)
{
! if (!redirect_edge_and_branch (edge_in, bb))
! abort ();
}
else
redirect_edge_succ (edge_in, bb);
--- 1378,1385 ----
jump instruction to target our new block. */
if ((edge_in->flags & EDGE_FALLTHRU) == 0)
{
! edge redirected = redirect_edge_and_branch (edge_in, bb);
! gcc_assert (redirected);
}
else
redirect_edge_succ (edge_in, bb);
*************** insert_insn_on_edge (rtx pattern, edge e
*** 1396,1403 ****
{
/* We cannot insert instructions on an abnormal critical edge.
It will be easier to find the culprit if we die now. */
! if ((e->flags & EDGE_ABNORMAL) && EDGE_CRITICAL_P (e))
! abort ();
if (e->insns.r == NULL_RTX)
start_sequence ();
--- 1396,1402 ----
{
/* We cannot insert instructions on an abnormal critical edge.
It will be easier to find the culprit if we die now. */
! gcc_assert (!((e->flags & EDGE_ABNORMAL) && EDGE_CRITICAL_P (e)));
if (e->insns.r == NULL_RTX)
start_sequence ();
*************** commit_one_edge_insertion (edge e, int w
*** 1584,1592 ****
;
else
{
! /* We'd better be fallthru, or we've lost track of what's what. */
! if ((e->flags & EDGE_FALLTHRU) == 0)
! abort ();
after = BB_END (bb);
}
--- 1583,1591 ----
;
else
{
! /* We'd better be fallthru, or we've lost track of
! what's what. */
! gcc_assert (e->flags & EDGE_FALLTHRU);
after = BB_END (bb);
}
*************** commit_one_edge_insertion (edge e, int w
*** 1647,1655 ****
to EXIT. */
e = bb->succ;
! if (e->dest != EXIT_BLOCK_PTR
! || e->succ_next != NULL || (e->flags & EDGE_FALLTHRU) == 0)
! abort ();
e->flags &= ~EDGE_FALLTHRU;
emit_barrier_after (last);
--- 1646,1653 ----
to EXIT. */
e = bb->succ;
! gcc_assert (e->dest == EXIT_BLOCK_PTR
! && !e->succ_next && (e->flags & EDGE_FALLTHRU));
e->flags &= ~EDGE_FALLTHRU;
emit_barrier_after (last);
*************** commit_one_edge_insertion (edge e, int w
*** 1657,1664 ****
if (before)
delete_insn (before);
}
! else if (JUMP_P (last))
! abort ();
/* Mark the basic block for find_sub_basic_blocks. */
bb->aux = &bb->aux;
--- 1655,1662 ----
if (before)
delete_insn (before);
}
! else
! gcc_assert (!JUMP_P (last));
/* Mark the basic block for find_sub_basic_blocks. */
bb->aux = &bb->aux;
*************** commit_edge_insertions (void)
*** 1703,1710 ****
SET_BIT (blocks, bb->index);
/* Check for forgotten bb->aux values before commit_edge_insertions
call. */
! if (bb->aux != &bb->aux)
! abort ();
bb->aux = NULL;
}
find_many_sub_basic_blocks (blocks);
--- 1701,1707 ----
SET_BIT (blocks, bb->index);
/* Check for forgotten bb->aux values before commit_edge_insertions
call. */
! gcc_assert (bb->aux == &bb->aux);
bb->aux = NULL;
}
find_many_sub_basic_blocks (blocks);
*************** commit_edge_insertions_watch_calls (void
*** 1751,1758 ****
SET_BIT (blocks, bb->index);
/* Check for forgotten bb->aux values before commit_edge_insertions
call. */
! if (bb->aux != &bb->aux)
! abort ();
bb->aux = NULL;
}
find_many_sub_basic_blocks (blocks);
--- 1748,1754 ----
SET_BIT (blocks, bb->index);
/* Check for forgotten bb->aux values before commit_edge_insertions
call. */
! gcc_assert (bb->aux == &bb->aux);
bb->aux = NULL;
}
find_many_sub_basic_blocks (blocks);
*************** purge_dead_edges (basic_block bb)
*** 2397,2406 ****
from non-local gotos and the like. If there were, we shouldn't
have created the sibcall in the first place. Second, there
should of course never have been a fallthru edge. */
! if (!bb->succ || bb->succ->succ_next)
! abort ();
! if (bb->succ->flags != (EDGE_SIBCALL | EDGE_ABNORMAL))
! abort ();
return 0;
}
--- 2393,2400 ----
from non-local gotos and the like. If there were, we shouldn't
have created the sibcall in the first place. Second, there
should of course never have been a fallthru edge. */
! gcc_assert (bb->succ && !bb->succ->succ_next);
! gcc_assert (bb->succ->flags == (EDGE_SIBCALL | EDGE_ABNORMAL));
return 0;
}
*************** purge_dead_edges (basic_block bb)
*** 2428,2435 ****
}
}
! if (!bb->succ || bb->succ->succ_next)
! abort ();
bb->succ->probability = REG_BR_PROB_BASE;
bb->succ->count = bb->count;
--- 2422,2428 ----
}
}
! gcc_assert (bb->succ && !bb->succ->succ_next);
bb->succ->probability = REG_BR_PROB_BASE;
bb->succ->count = bb->count;
*************** cfg_layout_redirect_edge_and_branch (edg
*** 2533,2545 ****
&& label_is_jump_target_p (BB_HEAD (e->dest),
BB_END (src)))
{
if (dump_file)
fprintf (dump_file, "Fallthru edge unified with branch "
"%i->%i redirected to %i\n",
e->src->index, e->dest->index, dest->index);
e->flags &= ~EDGE_FALLTHRU;
! if (!redirect_branch_edge (e, dest))
! abort ();
e->flags |= EDGE_FALLTHRU;
e->src->flags |= BB_DIRTY;
return e;
--- 2526,2540 ----
&& label_is_jump_target_p (BB_HEAD (e->dest),
BB_END (src)))
{
+ edge redirected;
+
if (dump_file)
fprintf (dump_file, "Fallthru edge unified with branch "
"%i->%i redirected to %i\n",
e->src->index, e->dest->index, dest->index);
e->flags &= ~EDGE_FALLTHRU;
! redirected = redirect_branch_edge (e, dest);
! gcc_assert (redirected);
e->flags |= EDGE_FALLTHRU;
e->src->flags |= BB_DIRTY;
return e;
*************** cfg_layout_redirect_edge_and_branch (edg
*** 2564,2571 ****
ret = redirect_branch_edge (e, dest);
/* We don't want simplejumps in the insn stream during cfglayout. */
! if (simplejump_p (BB_END (src)))
! abort ();
src->flags |= BB_DIRTY;
return ret;
--- 2559,2565 ----
ret = redirect_branch_edge (e, dest);
/* We don't want simplejumps in the insn stream during cfglayout. */
! gcc_assert (!simplejump_p (BB_END (src)));
src->flags |= BB_DIRTY;
return ret;
*************** cfg_layout_redirect_edge_and_branch (edg
*** 2575,2582 ****
static basic_block
cfg_layout_redirect_edge_and_branch_force (edge e, basic_block dest)
{
! if (!cfg_layout_redirect_edge_and_branch (e, dest))
! abort ();
return NULL;
}
--- 2569,2577 ----
static basic_block
cfg_layout_redirect_edge_and_branch_force (edge e, basic_block dest)
{
! edge redirected = cfg_layout_redirect_edge_and_branch (e, dest);
!
! gcc_assert (redirected);
return NULL;
}
*************** static void
*** 2700,2707 ****
cfg_layout_merge_blocks (basic_block a, basic_block b)
{
#ifdef ENABLE_CHECKING
! if (!cfg_layout_can_merge_blocks_p (a, b))
! abort ();
#endif
/* If there was a CODE_LABEL beginning B, delete it. */
--- 2695,2701 ----
cfg_layout_merge_blocks (basic_block a, basic_block b)
{
#ifdef ENABLE_CHECKING
! gcc_assert (cfg_layout_can_merge_blocks_p (a, b));
#endif
/* If there was a CODE_LABEL beginning B, delete it. */
*************** cfg_layout_merge_blocks (basic_block a,
*** 2712,2719 ****
it cleaned up. */
if (JUMP_P (BB_END (a)))
try_redirect_by_replacing_jump (a->succ, b, true);
! if (JUMP_P (BB_END (a)))
! abort ();
/* Possible line number notes should appear in between. */
if (b->rbi->header)
--- 2706,2712 ----
it cleaned up. */
if (JUMP_P (BB_END (a)))
try_redirect_by_replacing_jump (a->succ, b, true);
! gcc_assert (!JUMP_P (BB_END (a)));
/* Possible line number notes should appear in between. */
if (b->rbi->header)
*************** cfg_layout_merge_blocks (basic_block a,
*** 2734,2741 ****
/* Skip possible DELETED_LABEL insn. */
if (!NOTE_INSN_BASIC_BLOCK_P (first))
first = NEXT_INSN (first);
! if (!NOTE_INSN_BASIC_BLOCK_P (first))
! abort ();
BB_HEAD (b) = NULL;
delete_insn (first);
}
--- 2727,2733 ----
/* Skip possible DELETED_LABEL insn. */
if (!NOTE_INSN_BASIC_BLOCK_P (first))
first = NEXT_INSN (first);
! gcc_assert (NOTE_INSN_BASIC_BLOCK_P (first));
BB_HEAD (b) = NULL;
delete_insn (first);
}
*************** cfg_layout_merge_blocks (basic_block a,
*** 2752,2759 ****
/* Skip possible DELETED_LABEL insn. */
if (!NOTE_INSN_BASIC_BLOCK_P (insn))
insn = NEXT_INSN (insn);
! if (!NOTE_INSN_BASIC_BLOCK_P (insn))
! abort ();
BB_HEAD (b) = NULL;
BB_END (a) = BB_END (b);
delete_insn (insn);
--- 2744,2750 ----
/* Skip possible DELETED_LABEL insn. */
if (!NOTE_INSN_BASIC_BLOCK_P (insn))
insn = NEXT_INSN (insn);
! gcc_assert (NOTE_INSN_BASIC_BLOCK_P (insn));
BB_HEAD (b) = NULL;
BB_END (a) = BB_END (b);
delete_insn (insn);
*************** rtl_flow_call_edges_add (sbitmap blocks)
*** 2963,2970 ****
#ifdef ENABLE_CHECKING
if (split_at_insn == BB_END (bb))
for (e = bb->succ; e; e = e->succ_next)
! if (e->dest == EXIT_BLOCK_PTR)
! abort ();
#endif
/* Note that the following may create a new basic block
--- 2954,2960 ----
#ifdef ENABLE_CHECKING
if (split_at_insn == BB_END (bb))
for (e = bb->succ; e; e = e->succ_next)
! gcc_assert (e->dest != EXIT_BLOCK_PTR);
#endif
/* Note that the following may create a new basic block
Index: cgraph.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraph.c,v
retrieving revision 1.54
diff -c -3 -p -r1.54 cgraph.c
*** cgraph.c 6 Sep 2004 10:07:45 -0000 1.54
--- cgraph.c 7 Sep 2004 12:31:09 -0000
*************** cgraph_node (tree decl)
*** 170,177 ****
{
struct cgraph_node key, *node, **slot;
! if (TREE_CODE (decl) != FUNCTION_DECL)
! abort ();
if (!cgraph_hash)
cgraph_hash = htab_create_ggc (10, hash_node, eq_node, NULL);
--- 170,176 ----
{
struct cgraph_node key, *node, **slot;
! gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
if (!cgraph_hash)
cgraph_hash = htab_create_ggc (10, hash_node, eq_node, NULL);
*************** cgraph_create_edge (struct cgraph_node *
*** 223,234 ****
struct cgraph_edge *e;
for (e = caller->callees; e; e = e->next_callee)
! if (e->call_expr == call_expr)
! abort ();
#endif
! if (TREE_CODE (call_expr) != CALL_EXPR)
! abort ();
if (!DECL_SAVED_TREE (callee->decl))
edge->inline_failed = N_("function body not available");
--- 222,231 ----
struct cgraph_edge *e;
for (e = caller->callees; e; e = e->next_callee)
! gcc_assert (e->call_expr != call_expr);
#endif
! gcc_assert (TREE_CODE (call_expr) == CALL_EXPR);
if (!DECL_SAVED_TREE (callee->decl))
edge->inline_failed = N_("function body not available");
*************** cgraph_remove_edge (struct cgraph_edge *
*** 262,275 ****
for (edge = &e->callee->callers; *edge && *edge != e;
edge = &((*edge)->next_caller))
continue;
! if (!*edge)
! abort ();
*edge = (*edge)->next_caller;
for (edge2 = &e->caller->callees; *edge2 && *edge2 != e;
edge2 = &(*edge2)->next_callee)
continue;
! if (!*edge2)
! abort ();
*edge2 = (*edge2)->next_callee;
}
--- 259,270 ----
for (edge = &e->callee->callers; *edge && *edge != e;
edge = &((*edge)->next_caller))
continue;
! gcc_assert (*edge);
*edge = (*edge)->next_caller;
for (edge2 = &e->caller->callees; *edge2 && *edge2 != e;
edge2 = &(*edge2)->next_callee)
continue;
! gcc_assert (*edge2);
*edge2 = (*edge2)->next_callee;
}
*************** cgraph_redirect_edge_callee (struct cgra
*** 284,291 ****
for (edge = &e->callee->callers; *edge && *edge != e;
edge = &((*edge)->next_caller))
continue;
! if (!*edge)
! abort ();
*edge = (*edge)->next_caller;
e->callee = n;
e->next_caller = n->callers;
--- 279,285 ----
for (edge = &e->callee->callers; *edge && *edge != e;
edge = &((*edge)->next_caller))
continue;
! gcc_assert (*edge);
*edge = (*edge)->next_caller;
e->callee = n;
e->next_caller = n->callers;
*************** struct cgraph_local_info *
*** 412,419 ****
cgraph_local_info (tree decl)
{
struct cgraph_node *node;
! if (TREE_CODE (decl) != FUNCTION_DECL)
! abort ();
node = cgraph_node (decl);
return &node->local;
}
--- 406,413 ----
cgraph_local_info (tree decl)
{
struct cgraph_node *node;
!
! gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
node = cgraph_node (decl);
return &node->local;
}
*************** struct cgraph_global_info *
*** 424,431 ****
cgraph_global_info (tree decl)
{
struct cgraph_node *node;
! if (TREE_CODE (decl) != FUNCTION_DECL || !cgraph_global_info_ready)
! abort ();
node = cgraph_node (decl);
return &node->global;
}
--- 418,425 ----
cgraph_global_info (tree decl)
{
struct cgraph_node *node;
!
! gcc_assert (TREE_CODE (decl) == FUNCTION_DECL && cgraph_global_info_ready);
node = cgraph_node (decl);
return &node->global;
}
*************** struct cgraph_rtl_info *
*** 436,443 ****
cgraph_rtl_info (tree decl)
{
struct cgraph_node *node;
! if (TREE_CODE (decl) != FUNCTION_DECL)
! abort ();
node = cgraph_node (decl);
if (decl != current_function_decl
&& !TREE_ASM_WRITTEN (node->decl))
--- 430,437 ----
cgraph_rtl_info (tree decl)
{
struct cgraph_node *node;
!
! gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
node = cgraph_node (decl);
if (decl != current_function_decl
&& !TREE_ASM_WRITTEN (node->decl))
*************** cgraph_varpool_node (tree decl)
*** 542,549 ****
{
struct cgraph_varpool_node key, *node, **slot;
! if (!DECL_P (decl) || TREE_CODE (decl) == FUNCTION_DECL)
! abort ();
if (!cgraph_varpool_hash)
cgraph_varpool_hash = htab_create_ggc (10, hash_varpool_node,
--- 536,542 ----
{
struct cgraph_varpool_node key, *node, **slot;
! gcc_assert (DECL_P (decl) && TREE_CODE (decl) != FUNCTION_DECL);
if (!cgraph_varpool_hash)
cgraph_varpool_hash = htab_create_ggc (10, hash_varpool_node,
Index: cgraphunit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraphunit.c,v
retrieving revision 1.74
diff -c -3 -p -r1.74 cgraphunit.c
*** cgraphunit.c 6 Sep 2004 10:07:45 -0000 1.74
--- cgraphunit.c 7 Sep 2004 12:31:13 -0000
*************** cgraph_finalize_function (tree decl, boo
*** 329,336 ****
case can be sort-of legitimately seen with real function
redefinition errors. I would argue that the front end should
never present us with such a case, but don't enforce that for now. */
! if (node->output)
! abort ();
/* Reset our data structures so we can analyze the function again. */
memset (&node->local, 0, sizeof (node->local));
--- 329,335 ----
case can be sort-of legitimately seen with real function
redefinition errors. I would argue that the front end should
never present us with such a case, but don't enforce that for now. */
! gcc_assert (!node->output);
/* Reset our data structures so we can analyze the function again. */
memset (&node->local, 0, sizeof (node->local));
*************** cgraph_finalize_compilation_unit (void)
*** 697,704 ****
if (!DECL_SAVED_TREE (decl))
continue;
! if (node->analyzed || !node->reachable || !DECL_SAVED_TREE (decl))
! abort ();
cgraph_analyze_function (node);
--- 696,703 ----
if (!DECL_SAVED_TREE (decl))
continue;
! gcc_assert (!node->analyzed && node->reachable);
! gcc_assert (DECL_SAVED_TREE (decl));
cgraph_analyze_function (node);
*************** cgraph_mark_functions_to_output (void)
*** 756,763 ****
{
tree decl = node->decl;
struct cgraph_edge *e;
! if (node->output)
! abort ();
for (e = node->callers; e; e = e->next_caller)
if (e->inline_failed)
--- 755,762 ----
{
tree decl = node->decl;
struct cgraph_edge *e;
!
! gcc_assert (!node->output);
for (e = node->callers; e; e = e->next_caller)
if (e->inline_failed)
*************** cgraph_mark_functions_to_output (void)
*** 773,785 ****
&& !TREE_ASM_WRITTEN (decl)
&& !DECL_EXTERNAL (decl))
node->output = 1;
! /* We should've reclaimed all functions that are not needed. */
! else if (!node->global.inlined_to && DECL_SAVED_TREE (decl)
! && !DECL_EXTERNAL (decl))
! {
! dump_cgraph_node (stderr, node);
! abort ();
! }
}
}
--- 772,781 ----
&& !TREE_ASM_WRITTEN (decl)
&& !DECL_EXTERNAL (decl))
node->output = 1;
! else
! /* We should've reclaimed all functions that are not needed. */
! gcc_assert (node->global.inlined_to || !DECL_SAVED_TREE (decl)
! || DECL_EXTERNAL (decl));
}
}
*************** cgraph_expand_function (struct cgraph_no
*** 791,798 ****
tree decl = node->decl;
/* We ought to not compile any inline clones. */
! if (node->global.inlined_to)
! abort ();
if (flag_unit_at_a_time)
announce_function (decl);
--- 787,793 ----
tree decl = node->decl;
/* We ought to not compile any inline clones. */
! gcc_assert (!node->global.inlined_to);
if (flag_unit_at_a_time)
announce_function (decl);
*************** cgraph_expand_function (struct cgraph_no
*** 802,809 ****
/* Make sure that BE didn't give up on compiling. */
/* ??? Can happen with nested function of extern inline. */
! if (!TREE_ASM_WRITTEN (node->decl))
! abort ();
current_function_decl = NULL;
if (DECL_SAVED_TREE (node->decl)
--- 797,803 ----
/* Make sure that BE didn't give up on compiling. */
/* ??? Can happen with nested function of extern inline. */
! gcc_assert (TREE_ASM_WRITTEN (node->decl));
current_function_decl = NULL;
if (DECL_SAVED_TREE (node->decl)
*************** cgraph_remove_unreachable_nodes (void)
*** 895,902 ****
fprintf (cgraph_dump_file, "\nReclaiming functions:");
#ifdef ENABLE_CHECKING
for (node = cgraph_nodes; node; node = node->next)
! if (node->aux)
! abort ();
#endif
for (node = cgraph_nodes; node; node = node->next)
if (node->needed && !node->global.inlined_to
--- 889,895 ----
fprintf (cgraph_dump_file, "\nReclaiming functions:");
#ifdef ENABLE_CHECKING
for (node = cgraph_nodes; node; node = node->next)
! gcc_assert (!node->aux);
#endif
for (node = cgraph_nodes; node; node = node->next)
if (node->needed && !node->global.inlined_to
*************** cgraph_remove_unreachable_nodes (void)
*** 905,912 ****
node->aux = first;
first = node;
}
! else if (node->aux)
! abort ();
/* Perform reachability analysis. As a special case do not consider
extern inline functions not inlined as live because we won't output
--- 898,905 ----
node->aux = first;
first = node;
}
! else
! gcc_assert (!node->aux);
/* Perform reachability analysis. As a special case do not consider
extern inline functions not inlined as live because we won't output
*************** cgraph_clone_inlined_nodes (struct cgrap
*** 1040,1047 ****
&& duplicate
&& flag_unit_at_a_time)
{
! if (e->callee->global.inlined_to)
! abort ();
if (!DECL_EXTERNAL (e->callee->decl))
overall_insns -= e->callee->global.insns, nfunctions_inlined++;
duplicate = 0;
--- 1033,1039 ----
&& duplicate
&& flag_unit_at_a_time)
{
! gcc_assert (!e->callee->global.inlined_to);
if (!DECL_EXTERNAL (e->callee->decl))
overall_insns -= e->callee->global.insns, nfunctions_inlined++;
duplicate = 0;
*************** cgraph_mark_inline_edge (struct cgraph_e
*** 1071,1078 ****
int old_insns = 0, new_insns = 0;
struct cgraph_node *to = NULL, *what;
! if (!e->inline_failed)
! abort ();
e->inline_failed = NULL;
if (!e->callee->global.inlined && flag_unit_at_a_time)
--- 1063,1069 ----
int old_insns = 0, new_insns = 0;
struct cgraph_node *to = NULL, *what;
! gcc_assert (e->inline_failed);
e->inline_failed = NULL;
if (!e->callee->global.inlined && flag_unit_at_a_time)
*************** cgraph_mark_inline_edge (struct cgraph_e
*** 1089,1101 ****
old_insns = e->caller->global.insns;
new_insns = cgraph_estimate_size_after_inlining (1, e->caller,
what);
! if (new_insns < 0)
! abort ();
to = e->caller;
to->global.insns = new_insns;
}
! if (what->global.inlined_to != to)
! abort ();
overall_insns += new_insns - old_insns;
ncalls_inlined++;
}
--- 1080,1090 ----
old_insns = e->caller->global.insns;
new_insns = cgraph_estimate_size_after_inlining (1, e->caller,
what);
! gcc_assert (new_insns >= 0);
to = e->caller;
to->global.insns = new_insns;
}
! gcc_assert (what->global.inlined_to == to);
overall_insns += new_insns - old_insns;
ncalls_inlined++;
}
*************** cgraph_mark_inline (struct cgraph_edge *
*** 1122,1132 ****
cgraph_mark_inline_edge (e);
if (e == edge)
edge = next;
! times ++;
}
}
! if (!times)
! abort ();
return edge;
}
--- 1111,1120 ----
cgraph_mark_inline_edge (e);
if (e == edge)
edge = next;
! times++;
}
}
! gcc_assert (times);
return edge;
}
*************** cgraph_expand_all_functions (void)
*** 1653,1660 ****
cgraph_mark_functions_to_output ();
order_pos = cgraph_postorder (order);
! if (order_pos != cgraph_n_nodes)
! abort ();
/* Garbage collector may remove inline clones we eliminate during
optimization. So we must be sure to not reference them. */
--- 1641,1647 ----
cgraph_mark_functions_to_output ();
order_pos = cgraph_postorder (order);
! gcc_assert (order_pos == cgraph_n_nodes);
/* Garbage collector may remove inline clones we eliminate during
optimization. So we must be sure to not reference them. */
*************** cgraph_expand_all_functions (void)
*** 1667,1674 ****
node = order[i];
if (node->output)
{
! if (!node->reachable)
! abort ();
node->output = 0;
cgraph_expand_function (node);
}
--- 1654,1660 ----
node = order[i];
if (node->output)
{
! gcc_assert (node->reachable);
node->output = 0;
cgraph_expand_function (node);
}
*************** cgraph_build_static_cdtor (char which, t
*** 1831,1842 ****
DECL_SOURCE_LOCATION (decl) = input_location;
cfun->function_end_locus = input_location;
! if (which == 'I')
! DECL_STATIC_CONSTRUCTOR (decl) = 1;
! else if (which == 'D')
! DECL_STATIC_DESTRUCTOR (decl) = 1;
! else
! abort ();
gimplify_function_tree (decl);
--- 1817,1833 ----
DECL_SOURCE_LOCATION (decl) = input_location;
cfun->function_end_locus = input_location;
! switch (which)
! {
! case 'I':
! DECL_STATIC_CONSTRUCTOR (decl) = 1;
! break;
! case 'D':
! DECL_STATIC_DESTRUCTOR (decl) = 1;
! break;
! default:
! gcc_unreachable ();
! }
gimplify_function_tree (decl);
Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.452
diff -c -3 -p -r1.452 combine.c
*** combine.c 5 Sep 2004 16:04:52 -0000 1.452
--- combine.c 7 Sep 2004 12:31:41 -0000
*************** do_SUBST (rtx *into, rtx newval)
*** 455,463 ****
{
/* Sanity check that we're replacing oldval with a CONST_INT
that is a valid sign-extension for the original mode. */
! if (INTVAL (newval) != trunc_int_for_mode (INTVAL (newval),
! GET_MODE (oldval)))
! abort ();
/* Replacing the operand of a SUBREG or a ZERO_EXTEND with a
CONST_INT is not valid, because after the replacement, the
--- 455,462 ----
{
/* Sanity check that we're replacing oldval with a CONST_INT
that is a valid sign-extension for the original mode. */
! gcc_assert (INTVAL (newval)
! == trunc_int_for_mode (INTVAL (newval), GET_MODE (oldval)));
/* Replacing the operand of a SUBREG or a ZERO_EXTEND with a
CONST_INT is not valid, because after the replacement, the
*************** do_SUBST (rtx *into, rtx newval)
*** 465,475 ****
when do_SUBST is called to replace the operand thereof, so we
perform this test on oldval instead, checking whether an
invalid replacement took place before we got here. */
! if ((GET_CODE (oldval) == SUBREG
! && GET_CODE (SUBREG_REG (oldval)) == CONST_INT)
! || (GET_CODE (oldval) == ZERO_EXTEND
! && GET_CODE (XEXP (oldval, 0)) == CONST_INT))
! abort ();
}
if (undobuf.frees)
--- 464,473 ----
when do_SUBST is called to replace the operand thereof, so we
perform this test on oldval instead, checking whether an
invalid replacement took place before we got here. */
! gcc_assert (!(GET_CODE (oldval) == SUBREG
! && GET_CODE (SUBREG_REG (oldval)) == CONST_INT));
! gcc_assert (!(GET_CODE (oldval) == ZERO_EXTEND
! && GET_CODE (XEXP (oldval, 0)) == CONST_INT));
}
if (undobuf.frees)
*************** try_combine (rtx i3, rtx i2, rtx i1, int
*** 1746,1753 ****
{
/* We don't handle the case of the target word being wider
than a host wide int. */
! if (HOST_BITS_PER_WIDE_INT < BITS_PER_WORD)
! abort ();
lo &= ~(UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD (1) - 1);
lo |= (INTVAL (SET_SRC (PATTERN (i3)))
--- 1744,1750 ----
{
/* We don't handle the case of the target word being wider
than a host wide int. */
! gcc_assert (HOST_BITS_PER_WIDE_INT >= BITS_PER_WORD);
lo &= ~(UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD (1) - 1);
lo |= (INTVAL (SET_SRC (PATTERN (i3)))
*************** try_combine (rtx i3, rtx i2, rtx i1, int
*** 1770,1776 ****
else
/* We don't handle the case of the higher word not fitting
entirely in either hi or lo. */
! abort ();
combine_merges++;
subst_insn = i3;
--- 1767,1773 ----
else
/* We don't handle the case of the higher word not fitting
entirely in either hi or lo. */
! gcc_unreachable ();
combine_merges++;
subst_insn = i3;
*************** subst (rtx x, rtx from, rtx to, int in_d
*** 3639,3646 ****
{
x = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x),
new, GET_MODE (XEXP (x, 0)));
! if (! x)
! abort ();
}
else
SUBST (XEXP (x, i), new);
--- 3636,3642 ----
{
x = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x),
new, GET_MODE (XEXP (x, 0)));
! gcc_assert (x);
}
else
SUBST (XEXP (x, i), new);
*************** combine_simplify_rtx (rtx x, enum machin
*** 4693,4700 ****
rtx op1 = XEXP (x, 1);
int len;
! if (GET_CODE (op1) != PARALLEL)
! abort ();
len = XVECLEN (op1, 0);
if (len == 1
&& GET_CODE (XVECEXP (op1, 0, 0)) == CONST_INT
--- 4689,4695 ----
rtx op1 = XEXP (x, 1);
int len;
! gcc_assert (GET_CODE (op1) == PARALLEL);
len = XVECLEN (op1, 0);
if (len == 1
&& GET_CODE (XVECEXP (op1, 0, 0)) == CONST_INT
*************** simplify_logical (rtx x)
*** 5699,5705 ****
break;
default:
! abort ();
}
return x;
--- 5694,5700 ----
break;
default:
! gcc_unreachable ();
}
return x;
*************** distribute_notes (rtx notes, rtx from_in
*** 11705,11714 ****
case REG_NON_LOCAL_GOTO:
if (JUMP_P (i3))
place = i3;
- else if (i2 && JUMP_P (i2))
- place = i2;
else
! abort ();
break;
case REG_EH_REGION:
--- 11700,11710 ----
case REG_NON_LOCAL_GOTO:
if (JUMP_P (i3))
place = i3;
else
! {
! gcc_assert (i2 && JUMP_P (i2));
! place = i2;
! }
break;
case REG_EH_REGION:
*************** distribute_notes (rtx notes, rtx from_in
*** 11717,11724 ****
place = i3;
else if (i2 && CALL_P (i2))
place = i2;
! else if (flag_non_call_exceptions)
{
if (may_trap_p (i3))
place = i3;
else if (i2 && may_trap_p (i2))
--- 11713,11721 ----
place = i3;
else if (i2 && CALL_P (i2))
place = i2;
! else
{
+ gcc_assert (flag_non_call_exceptions);
if (may_trap_p (i3))
place = i3;
else if (i2 && may_trap_p (i2))
*************** distribute_notes (rtx notes, rtx from_in
*** 11727,11734 ****
can now prove that the instructions can't trap. Drop the
note in this case. */
}
- else
- abort ();
break;
case REG_ALWAYS_RETURN:
--- 11724,11729 ----
*************** distribute_notes (rtx notes, rtx from_in
*** 11738,11747 ****
possible for both I2 and I3 to be a call. */
if (CALL_P (i3))
place = i3;
- else if (i2 && CALL_P (i2))
- place = i2;
else
! abort ();
break;
case REG_UNUSED:
--- 11733,11743 ----
possible for both I2 and I3 to be a call. */
if (CALL_P (i3))
place = i3;
else
! {
! gcc_assert (i2 && CALL_P (i2));
! place = i2;
! }
break;
case REG_UNUSED:
*************** distribute_notes (rtx notes, rtx from_in
*** 11848,11869 ****
a JUMP_LABEL instead or decrement LABEL_NUSES. */
if (place && JUMP_P (place))
{
! if (!JUMP_LABEL (place))
JUMP_LABEL (place) = XEXP (note, 0);
! else if (JUMP_LABEL (place) != XEXP (note, 0))
! abort ();
! else if (LABEL_P (JUMP_LABEL (place)))
! LABEL_NUSES (JUMP_LABEL (place))--;
place = 0;
}
if (place2 && JUMP_P (place2))
{
! if (!JUMP_LABEL (place2))
JUMP_LABEL (place2) = XEXP (note, 0);
! else if (JUMP_LABEL (place2) != XEXP (note, 0))
! abort ();
! else if (LABEL_P (JUMP_LABEL (place2)))
! LABEL_NUSES (JUMP_LABEL (place2))--;
place2 = 0;
}
break;
--- 11844,11873 ----
a JUMP_LABEL instead or decrement LABEL_NUSES. */
if (place && JUMP_P (place))
{
! rtx label = JUMP_LABEL (place);
!
! if (!label)
JUMP_LABEL (place) = XEXP (note, 0);
! else
! {
! gcc_assert (label == XEXP (note, 0));
! if (LABEL_P (label))
! LABEL_NUSES (label)--;
! }
place = 0;
}
if (place2 && JUMP_P (place2))
{
! rtx label = JUMP_LABEL (place2);
!
! if (!label)
JUMP_LABEL (place2) = XEXP (note, 0);
! else
! {
! gcc_assert (label == XEXP (note, 0));
! if (LABEL_P (label))
! LABEL_NUSES (label)--;
! }
place2 = 0;
}
break;
*************** distribute_notes (rtx notes, rtx from_in
*** 12192,12198 ****
default:
/* Any other notes should not be present at this point in the
compilation. */
! abort ();
}
if (place)
--- 12196,12202 ----
default:
/* Any other notes should not be present at this point in the
compilation. */
! gcc_unreachable ();
}
if (place)
*************** insn_cuid (rtx insn)
*** 12348,12355 ****
&& NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == USE)
insn = NEXT_INSN (insn);
! if (INSN_UID (insn) > max_uid_cuid)
! abort ();
return INSN_CUID (insn);
}
--- 12352,12358 ----
&& NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == USE)
insn = NEXT_INSN (insn);
! gcc_assert (INSN_UID (insn) <= max_uid_cuid);
return INSN_CUID (insn);
}
Index: conflict.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/conflict.c,v
retrieving revision 1.23
diff -c -3 -p -r1.23 conflict.c
*** conflict.c 15 Jun 2004 18:02:11 -0000 1.23
--- conflict.c 7 Sep 2004 12:31:42 -0000
*************** conflict_graph_add (conflict_graph graph
*** 190,197 ****
void **slot;
/* A reg cannot conflict with itself. */
! if (reg1 == reg2)
! abort ();
dummy.smaller = smaller;
dummy.larger = larger;
--- 190,196 ----
void **slot;
/* A reg cannot conflict with itself. */
! gcc_assert (reg1 != reg2);
dummy.smaller = smaller;
dummy.larger = larger;
*************** print_conflict (int reg1, int reg2, void
*** 324,333 ****
is the interesting one. */
if (reg1 == context->reg)
reg = reg2;
- else if (reg2 == context->reg)
- reg = reg1;
else
! abort ();
/* Print the conflict. */
fprintf (context->fp, " %d", reg);
--- 323,333 ----
is the interesting one. */
if (reg1 == context->reg)
reg = reg2;
else
! {
! gcc_assert (reg2 == context->reg);
! reg = reg1;
! }
/* Print the conflict. */
fprintf (context->fp, " %d", reg);
Index: coverage.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/coverage.c,v
retrieving revision 1.45
diff -c -3 -p -r1.45 coverage.c
*** coverage.c 25 Aug 2004 09:51:21 -0000 1.45
--- coverage.c 7 Sep 2004 12:31:43 -0000
*************** rtl_coverage_counter_ref (unsigned count
*** 403,410 ****
enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0);
rtx ref;
! if (no >= fn_n_ctrs[counter] - fn_b_ctrs[counter])
! abort ();
no += prg_n_ctrs[counter] + fn_b_ctrs[counter];
if (!ctr_labels[counter])
{
--- 403,409 ----
enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0);
rtx ref;
! gcc_assert (no < fn_n_ctrs[counter] - fn_b_ctrs[counter]);
no += prg_n_ctrs[counter] + fn_b_ctrs[counter];
if (!ctr_labels[counter])
{
*************** tree_coverage_counter_ref (unsigned coun
*** 428,435 ****
{
tree domain_type = TYPE_DOMAIN (TREE_TYPE (tree_ctr_tables[counter]));
! if (no >= fn_n_ctrs[counter] - fn_b_ctrs[counter])
! abort ();
no += prg_n_ctrs[counter] + fn_b_ctrs[counter];
/* "no" here is an array index, scaled to bytes later. */
--- 427,433 ----
{
tree domain_type = TYPE_DOMAIN (TREE_TYPE (tree_ctr_tables[counter]));
! gcc_assert (no < fn_n_ctrs[counter] - fn_b_ctrs[counter]);
no += prg_n_ctrs[counter] + fn_b_ctrs[counter];
/* "no" here is an array index, scaled to bytes later. */
*************** coverage_checksum_string (unsigned chksu
*** 462,467 ****
--- 460,466 ----
{
int y;
unsigned seed;
+ int scan;
for (y = 1; y < 9; y++)
if (!(string[i + y] >= '0' && string[i + y] <= '9')
*************** coverage_checksum_string (unsigned chksu
*** 475,482 ****
break;
if (y != 18)
continue;
! if (!sscanf (string + i + 10, "%X", &seed))
! abort ();
if (seed != crc32_string (0, flag_random_seed))
continue;
string = dup = xstrdup (string);
--- 474,481 ----
break;
if (y != 18)
continue;
! scan = sscanf (string + i + 10, "%X", &seed);
! gcc_assert (scan);
if (seed != crc32_string (0, flag_random_seed))
continue;
string = dup = xstrdup (string);
Index: cse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cse.c,v
retrieving revision 1.311
diff -c -3 -p -r1.311 cse.c
*** cse.c 25 Aug 2004 12:30:56 -0000 1.311
--- cse.c 7 Sep 2004 12:31:59 -0000
*************** make_new_qty (unsigned int reg, enum mac
*** 925,932 ****
struct qty_table_elem *ent;
struct reg_eqv_elem *eqv;
! if (next_qty >= max_qty)
! abort ();
q = REG_QTY (reg) = next_qty++;
ent = &qty_table[q];
--- 925,931 ----
struct qty_table_elem *ent;
struct reg_eqv_elem *eqv;
! gcc_assert (next_qty < max_qty);
q = REG_QTY (reg) = next_qty++;
ent = &qty_table[q];
*************** make_regs_eqv (unsigned int new, unsigne
*** 953,960 ****
ent = &qty_table[q];
/* Nothing should become eqv until it has a "non-invalid" qty number. */
! if (! REGNO_QTY_VALID_P (old))
! abort ();
REG_QTY (new) = q;
firstr = ent->first_reg;
--- 952,958 ----
ent = &qty_table[q];
/* Nothing should become eqv until it has a "non-invalid" qty number. */
! gcc_assert (REGNO_QTY_VALID_P (old));
REG_QTY (new) = q;
firstr = ent->first_reg;
*************** insert (rtx x, struct table_elt *classp,
*** 1424,1431 ****
/* If X is a register and we haven't made a quantity for it,
something is wrong. */
! if (REG_P (x) && ! REGNO_QTY_VALID_P (REGNO (x)))
! abort ();
/* If X is a hard register, show it is being put in the table. */
if (REG_P (x) && REGNO (x) < FIRST_PSEUDO_REGISTER)
--- 1422,1428 ----
/* If X is a register and we haven't made a quantity for it,
something is wrong. */
! gcc_assert (!REG_P (x) || REGNO_QTY_VALID_P (REGNO (x)));
/* If X is a hard register, show it is being put in the table. */
if (REG_P (x) && REGNO (x) < FIRST_PSEUDO_REGISTER)
*************** invalidate (rtx x, enum machine_mode ful
*** 1832,1838 ****
return;
default:
! abort ();
}
}
--- 1829,1835 ----
return;
default:
! gcc_unreachable ();
}
}
*************** hash_rtx (rtx x, enum machine_mode mode,
*** 2334,2341 ****
fmt = GET_RTX_FORMAT (code);
for (; i >= 0; i--)
{
! if (fmt[i] == 'e')
{
/* If we are about to do the last recursive call
needed at this level, change it into iteration.
This function is called enough to be worth it. */
--- 2331,2339 ----
fmt = GET_RTX_FORMAT (code);
for (; i >= 0; i--)
{
! switch (fmt[i])
{
+ case 'e':
/* If we are about to do the last recursive call
needed at this level, change it into iteration.
This function is called enough to be worth it. */
*************** hash_rtx (rtx x, enum machine_mode mode,
*** 2347,2370 ****
hash += hash_rtx (XEXP (x, i), 0, do_not_record_p,
hash_arg_in_memory_p, have_reg_qty);
! }
! else if (fmt[i] == 'E')
! for (j = 0; j < XVECLEN (x, i); j++)
! {
hash += hash_rtx (XVECEXP (x, i, j), 0, do_not_record_p,
hash_arg_in_memory_p, have_reg_qty);
! }
! else if (fmt[i] == 's')
! hash += hash_rtx_string (XSTR (x, i));
! else if (fmt[i] == 'i')
! hash += (unsigned int) XINT (x, i);
! else if (fmt[i] == '0' || fmt[i] == 't')
! /* Unused. */
! ;
! else
! abort ();
}
return hash;
--- 2345,2373 ----
hash += hash_rtx (XEXP (x, i), 0, do_not_record_p,
hash_arg_in_memory_p, have_reg_qty);
! break;
! case 'E':
! for (j = 0; j < XVECLEN (x, i); j++)
hash += hash_rtx (XVECEXP (x, i, j), 0, do_not_record_p,
hash_arg_in_memory_p, have_reg_qty);
! break;
! case 's':
! hash += hash_rtx_string (XSTR (x, i));
! break;
!
! case 'i':
! hash += (unsigned int) XINT (x, i);
! break;
!
! case '0': case 't':
! /* Unused. */
! break;
!
! default:
! gcc_unreachable ();
! }
}
return hash;
*************** exp_equiv_p (rtx x, rtx y, int validate,
*** 2573,2579 ****
break;
default:
! abort ();
}
}
--- 2576,2582 ----
break;
default:
! gcc_unreachable ();
}
}
*************** cse_basic_block (rtx from, rtx to, struc
*** 6979,6986 ****
}
}
! if (next_qty > max_qty)
! abort ();
free (qty_table + max_reg);
--- 6982,6988 ----
}
}
! gcc_assert (next_qty <= max_qty);
free (qty_table + max_reg);
*************** count_reg_usage (rtx x, int *counts, int
*** 7099,7105 ****
return;
case INSN_LIST:
! abort ();
default:
break;
--- 7101,7107 ----
return;
case INSN_LIST:
! gcc_unreachable ();
default:
break;
*************** cse_cc_succs (basic_block bb, rtx cc_reg
*** 7458,7465 ****
if (mode != comp_mode)
{
! if (! can_change_mode)
! abort ();
mode = comp_mode;
PUT_MODE (cc_src, mode);
}
--- 7460,7466 ----
if (mode != comp_mode)
{
! gcc_assert (can_change_mode);
mode = comp_mode;
PUT_MODE (cc_src, mode);
}
*************** cse_cc_succs (basic_block bb, rtx cc_reg
*** 7507,7514 ****
submode = cse_cc_succs (e->dest, cc_reg, cc_src, false);
if (submode != VOIDmode)
{
! if (submode != mode)
! abort ();
found_equiv = true;
can_change_mode = false;
}
--- 7508,7514 ----
submode = cse_cc_succs (e->dest, cc_reg, cc_src, false);
if (submode != VOIDmode)
{
! gcc_assert (submode == mode);
found_equiv = true;
can_change_mode = false;
}
*************** cse_condition_code_reg (void)
*** 7636,7643 ****
mode = cse_cc_succs (bb, cc_reg, cc_src, true);
if (mode != VOIDmode)
{
! if (mode != GET_MODE (cc_src))
! abort ();
if (mode != orig_mode)
{
rtx newreg = gen_rtx_REG (mode, REGNO (cc_reg));
--- 7636,7642 ----
mode = cse_cc_succs (bb, cc_reg, cc_src, true);
if (mode != VOIDmode)
{
! gcc_assert (mode == GET_MODE (cc_src));
if (mode != orig_mode)
{
rtx newreg = gen_rtx_REG (mode, REGNO (cc_reg));
Index: cselib.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cselib.c,v
retrieving revision 1.50
diff -c -3 -p -r1.50 cselib.c
*** cselib.c 18 Aug 2004 20:53:59 -0000 1.50
--- cselib.c 7 Sep 2004 12:32:02 -0000
*************** entry_and_rtx_equal_p (const void *entry
*** 235,243 ****
rtx x = (rtx) x_arg;
enum machine_mode mode = GET_MODE (x);
! if (GET_CODE (x) == CONST_INT
! || (mode == VOIDmode && GET_CODE (x) == CONST_DOUBLE))
! abort ();
if (mode != GET_MODE (v->u.val_rtx))
return 0;
--- 235,243 ----
rtx x = (rtx) x_arg;
enum machine_mode mode = GET_MODE (x);
! gcc_assert (GET_CODE (x) != CONST_INT
! && (mode != VOIDmode || GET_CODE (x) != CONST_DOUBLE));
!
if (mode != GET_MODE (v->u.val_rtx))
return 0;
*************** remove_useless_values (void)
*** 370,377 ****
htab_traverse (hash_table, discard_useless_values, 0);
! if (n_useless_values != 0)
! abort ();
}
/* Return the mode in which a register was last set. If X is not a
--- 370,376 ----
htab_traverse (hash_table, discard_useless_values, 0);
! gcc_assert (!n_useless_values);
}
/* Return the mode in which a register was last set. If X is not a
*************** rtx_equal_for_cselib_p (rtx x, rtx y)
*** 524,530 ****
contain anything but integers and other rtx's,
except for within LABEL_REFs and SYMBOL_REFs. */
default:
! abort ();
}
}
return 1;
--- 523,529 ----
contain anything but integers and other rtx's,
except for within LABEL_REFs and SYMBOL_REFs. */
default:
! gcc_unreachable ();
}
}
return 1;
*************** wrap_constant (enum machine_mode mode, r
*** 539,546 ****
if (GET_CODE (x) != CONST_INT
&& (GET_CODE (x) != CONST_DOUBLE || GET_MODE (x) != VOIDmode))
return x;
! if (mode == VOIDmode)
! abort ();
return gen_rtx_CONST (mode, x);
}
--- 538,544 ----
if (GET_CODE (x) != CONST_INT
&& (GET_CODE (x) != CONST_DOUBLE || GET_MODE (x) != VOIDmode))
return x;
! gcc_assert (mode != VOIDmode);
return gen_rtx_CONST (mode, x);
}
*************** cselib_hash_rtx (rtx x, enum machine_mod
*** 643,682 ****
fmt = GET_RTX_FORMAT (code);
for (; i >= 0; i--)
{
! if (fmt[i] == 'e')
{
! rtx tem = XEXP (x, i);
! unsigned int tem_hash = cselib_hash_rtx (tem, 0, create);
!
! if (tem_hash == 0)
! return 0;
!
! hash += tem_hash;
! }
! else if (fmt[i] == 'E')
! for (j = 0; j < XVECLEN (x, i); j++)
{
! unsigned int tem_hash = cselib_hash_rtx (XVECEXP (x, i, j), 0, create);
!
if (tem_hash == 0)
return 0;
!
hash += tem_hash;
}
! else if (fmt[i] == 's')
! {
! const unsigned char *p = (const unsigned char *) XSTR (x, i);
! if (p)
! while (*p)
! hash += *p++;
}
- else if (fmt[i] == 'i')
- hash += XINT (x, i);
- else if (fmt[i] == '0' || fmt[i] == 't')
- /* unused */;
- else
- abort ();
}
return hash ? hash : 1 + (unsigned int) GET_CODE (x);
--- 641,694 ----
fmt = GET_RTX_FORMAT (code);
for (; i >= 0; i--)
{
! switch (fmt[i])
{
! case 'e':
{
! rtx tem = XEXP (x, i);
! unsigned int tem_hash = cselib_hash_rtx (tem, 0, create);
!
if (tem_hash == 0)
return 0;
!
hash += tem_hash;
}
! break;
! case 'E':
! for (j = 0; j < XVECLEN (x, i); j++)
! {
! unsigned int tem_hash
! = cselib_hash_rtx (XVECEXP (x, i, j), 0, create);
!
! if (tem_hash == 0)
! return 0;
!
! hash += tem_hash;
! }
! break;
!
! case 's':
! {
! const unsigned char *p = (const unsigned char *) XSTR (x, i);
!
! if (p)
! while (*p)
! hash += *p++;
! break;
! }
!
! case 'i':
! hash += XINT (x, i);
! break;
! case '0':
! case 't':
! /* unused */
! break;
!
! default:
! gcc_unreachable ();
}
}
return hash ? hash : 1 + (unsigned int) GET_CODE (x);
*************** new_cselib_val (unsigned int value, enum
*** 690,699 ****
{
cselib_val *e = pool_alloc (cselib_val_pool);
! #ifdef ENABLE_CHECKING
! if (value == 0)
! abort ();
! #endif
e->value = value;
/* We use custom method to allocate this RTL construct because it accounts
--- 702,708 ----
{
cselib_val *e = pool_alloc (cselib_val_pool);
! gcc_assert (value);
e->value = value;
/* We use custom method to allocate this RTL construct because it accounts
*************** cselib_subst_to_values (rtx x)
*** 799,805 ****
if (GET_MODE (l->elt->u.val_rtx) == GET_MODE (x))
return l->elt->u.val_rtx;
! abort ();
case MEM:
e = cselib_lookup_mem (x, 0);
--- 808,814 ----
if (GET_MODE (l->elt->u.val_rtx) == GET_MODE (x))
return l->elt->u.val_rtx;
! gcc_unreachable ();
case MEM:
e = cselib_lookup_mem (x, 0);
*************** cselib_invalidate_regno (unsigned int re
*** 963,971 ****
unsigned int i;
/* If we see pseudos after reload, something is _wrong_. */
! if (reload_completed && regno >= FIRST_PSEUDO_REGISTER
! && reg_renumber[regno] >= 0)
! abort ();
/* Determine the range of registers that must be invalidated. For
pseudos, only REGNO is affected. For hard regs, we must take MODE
--- 972,979 ----
unsigned int i;
/* If we see pseudos after reload, something is _wrong_. */
! gcc_assert (!reload_completed || regno < FIRST_PSEUDO_REGISTER
! || reg_renumber[regno] < 0);
/* Determine the range of registers that must be invalidated. For
pseudos, only REGNO is affected. For hard regs, we must take MODE
*************** cselib_invalidate_regno (unsigned int re
*** 973,980 ****
if they contain values that overlap REGNO. */
if (regno < FIRST_PSEUDO_REGISTER)
{
! if (mode == VOIDmode)
! abort ();
if (regno < max_value_regs)
i = 0;
--- 981,987 ----
if they contain values that overlap REGNO. */
if (regno < FIRST_PSEUDO_REGISTER)
{
! gcc_assert (mode != VOIDmode);
if (regno < max_value_regs)
i = 0;
*************** cselib_record_set (rtx dest, cselib_val
*** 1188,1198 ****
}
else
{
! if (REG_VALUES (dreg)->elt == 0)
! REG_VALUES (dreg)->elt = src_elt;
! else
! /* The register should have been invalidated. */
! abort ();
}
if (src_elt->locs == 0)
--- 1195,1203 ----
}
else
{
! /* The register should have been invalidated. */
! gcc_assert (REG_VALUES (dreg)->elt == 0);
! REG_VALUES (dreg)->elt = src_elt;
}
if (src_elt->locs == 0)