diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-07 15:46:53 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-07 15:46:53 +0000 |
commit | cc636d560f756da291b909e5c1790ffba37c4e8c (patch) | |
tree | ce9be778c6fd5bbc5eb633ed0344673882ecdabe /gcc/combine.c | |
parent | 71bd4883d964169b14dfd5f83896fbc07cf2b55c (diff) | |
download | gcc-cc636d560f756da291b909e5c1790ffba37c4e8c.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87145 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 79 |
1 files changed, 41 insertions, 38 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index ea4c5b25747..6f1ce6c2759 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -455,9 +455,8 @@ do_SUBST (rtx *into, rtx newval) { /* 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 (); + 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 @@ -465,11 +464,10 @@ do_SUBST (rtx *into, rtx newval) 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 (); + 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) @@ -1746,8 +1744,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) { /* 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 (); + 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))) @@ -1770,7 +1767,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) else /* We don't handle the case of the higher word not fitting entirely in either hi or lo. */ - abort (); + gcc_unreachable (); combine_merges++; subst_insn = i3; @@ -3639,8 +3636,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) { x = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x), new, GET_MODE (XEXP (x, 0))); - if (! x) - abort (); + gcc_assert (x); } else SUBST (XEXP (x, i), new); @@ -4693,8 +4689,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) rtx op1 = XEXP (x, 1); int len; - if (GET_CODE (op1) != PARALLEL) - abort (); + gcc_assert (GET_CODE (op1) == PARALLEL); len = XVECLEN (op1, 0); if (len == 1 && GET_CODE (XVECEXP (op1, 0, 0)) == CONST_INT @@ -5699,7 +5694,7 @@ simplify_logical (rtx x) break; default: - abort (); + gcc_unreachable (); } return x; @@ -11705,10 +11700,11 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) case REG_NON_LOCAL_GOTO: if (JUMP_P (i3)) place = i3; - else if (i2 && JUMP_P (i2)) - place = i2; else - abort (); + { + gcc_assert (i2 && JUMP_P (i2)); + place = i2; + } break; case REG_EH_REGION: @@ -11717,8 +11713,9 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) place = i3; else if (i2 && CALL_P (i2)) place = i2; - else if (flag_non_call_exceptions) + else { + gcc_assert (flag_non_call_exceptions); if (may_trap_p (i3)) place = i3; else if (i2 && may_trap_p (i2)) @@ -11727,8 +11724,6 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) can now prove that the instructions can't trap. Drop the note in this case. */ } - else - abort (); break; case REG_ALWAYS_RETURN: @@ -11738,10 +11733,11 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) 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 (); + { + gcc_assert (i2 && CALL_P (i2)); + place = i2; + } break; case REG_UNUSED: @@ -11848,22 +11844,30 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) a JUMP_LABEL instead or decrement LABEL_NUSES. */ if (place && JUMP_P (place)) { - if (!JUMP_LABEL (place)) + rtx label = JUMP_LABEL (place); + + if (!label) 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))--; + else + { + gcc_assert (label == XEXP (note, 0)); + if (LABEL_P (label)) + LABEL_NUSES (label)--; + } place = 0; } if (place2 && JUMP_P (place2)) { - if (!JUMP_LABEL (place2)) + rtx label = JUMP_LABEL (place2); + + if (!label) 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))--; + else + { + gcc_assert (label == XEXP (note, 0)); + if (LABEL_P (label)) + LABEL_NUSES (label)--; + } place2 = 0; } break; @@ -12192,7 +12196,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) default: /* Any other notes should not be present at this point in the compilation. */ - abort (); + gcc_unreachable (); } if (place) @@ -12348,8 +12352,7 @@ insn_cuid (rtx insn) && NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == USE) insn = NEXT_INSN (insn); - if (INSN_UID (insn) > max_uid_cuid) - abort (); + gcc_assert (INSN_UID (insn) <= max_uid_cuid); return INSN_CUID (insn); } |