summaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-09-07 15:46:53 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2004-09-07 15:46:53 +0000
commit341c100fc52d5e5175ac3e3aa3caf096c8ac1378 (patch)
treece9be778c6fd5bbc5eb633ed0344673882ecdabe /gcc/cse.c
parent6b094f38d7561422c087a31d26a8d36b58d7a549 (diff)
downloadgcc-341c100fc52d5e5175ac3e3aa3caf096c8ac1378.tar.gz
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable.
* 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. From-SVN: r87145
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c63
1 files changed, 31 insertions, 32 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index bf025824cb3..7b540a6e6b2 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -925,8 +925,7 @@ make_new_qty (unsigned int reg, enum machine_mode mode)
struct qty_table_elem *ent;
struct reg_eqv_elem *eqv;
- if (next_qty >= max_qty)
- abort ();
+ gcc_assert (next_qty < max_qty);
q = REG_QTY (reg) = next_qty++;
ent = &qty_table[q];
@@ -953,8 +952,7 @@ make_regs_eqv (unsigned int new, unsigned int old)
ent = &qty_table[q];
/* Nothing should become eqv until it has a "non-invalid" qty number. */
- if (! REGNO_QTY_VALID_P (old))
- abort ();
+ gcc_assert (REGNO_QTY_VALID_P (old));
REG_QTY (new) = q;
firstr = ent->first_reg;
@@ -1424,8 +1422,7 @@ insert (rtx x, struct table_elt *classp, unsigned int hash, enum machine_mode mo
/* 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 ();
+ 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)
@@ -1832,7 +1829,7 @@ invalidate (rtx x, enum machine_mode full_mode)
return;
default:
- abort ();
+ gcc_unreachable ();
}
}
@@ -2334,8 +2331,9 @@ hash_rtx (rtx x, enum machine_mode mode, int *do_not_record_p,
fmt = GET_RTX_FORMAT (code);
for (; i >= 0; i--)
{
- if (fmt[i] == 'e')
+ 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. */
@@ -2347,24 +2345,29 @@ hash_rtx (rtx x, enum machine_mode mode, int *do_not_record_p,
hash += hash_rtx (XEXP (x, i), 0, do_not_record_p,
hash_arg_in_memory_p, have_reg_qty);
- }
+ break;
- else if (fmt[i] == 'E')
- for (j = 0; j < XVECLEN (x, i); j++)
- {
+ 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;
- 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 ();
+ 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;
@@ -2573,7 +2576,7 @@ exp_equiv_p (rtx x, rtx y, int validate, bool for_gcse)
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
@@ -6979,8 +6982,7 @@ cse_basic_block (rtx from, rtx to, struct branch_path *next_branch)
}
}
- if (next_qty > max_qty)
- abort ();
+ gcc_assert (next_qty <= max_qty);
free (qty_table + max_reg);
@@ -7099,7 +7101,7 @@ count_reg_usage (rtx x, int *counts, int incr)
return;
case INSN_LIST:
- abort ();
+ gcc_unreachable ();
default:
break;
@@ -7458,8 +7460,7 @@ cse_cc_succs (basic_block bb, rtx cc_reg, rtx cc_src, bool can_change_mode)
if (mode != comp_mode)
{
- if (! can_change_mode)
- abort ();
+ gcc_assert (can_change_mode);
mode = comp_mode;
PUT_MODE (cc_src, mode);
}
@@ -7507,8 +7508,7 @@ cse_cc_succs (basic_block bb, rtx cc_reg, rtx cc_src, bool can_change_mode)
submode = cse_cc_succs (e->dest, cc_reg, cc_src, false);
if (submode != VOIDmode)
{
- if (submode != mode)
- abort ();
+ gcc_assert (submode == mode);
found_equiv = true;
can_change_mode = false;
}
@@ -7636,8 +7636,7 @@ cse_condition_code_reg (void)
mode = cse_cc_succs (bb, cc_reg, cc_src, true);
if (mode != VOIDmode)
{
- if (mode != GET_MODE (cc_src))
- abort ();
+ gcc_assert (mode == GET_MODE (cc_src));
if (mode != orig_mode)
{
rtx newreg = gen_rtx_REG (mode, REGNO (cc_reg));