diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-10 09:22:28 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-10 09:22:28 +0000 |
commit | b690c0a33b1f18112b01f6213f82678d7aa9fe42 (patch) | |
tree | 53321caf2b610be1206b5d38f653d831c8fd72e4 /gcc/loop.c | |
parent | 856b332650b9d74b647e8bb4084c24e99e28462c (diff) | |
download | gcc-b690c0a33b1f18112b01f6213f82678d7aa9fe42.tar.gz |
* lambda-mat.c (lambda_matrix_inverse_hard): Use gcc_assert
and gcc_unreachable instead of abort.
* lambda.h (lambda_vector_min_nz): Likewise.
* langhooks.c lhd_set_decl_assembler_name, lhd_can_use_bit_fields_p,
lhd_incomplete_type_error, lhd_expand_expr, lhd_types_compatible_p,
lhd_gimplify_expr): Likewise.
* lcm.c (optimize_mode_switching): Likewise.
* local-alloc.c (update_equiv_regs, block_alloc, find_free_reg):
Likewise.
* loop-doloop.c (doloop_modify): Likewise.
* loop-invariant.c (record_use): Likewise.
* loop-iv.c (get_biv_step_1, get_biv_step, iv_analyze, get_iv_value,
canon_condition, simplify_using_condition,
simplify_using_initial_values, shorten_into_mode,
canonicalize_iv_subregs, iv_number_of_iterations): Likewise.
* loop-unroll.c (unroll_and_peel_loops, peel_loop_completely,
unroll_loop_constant_iterations, unroll_loop_runtime_iterations,
peel_loop_simple, unroll_loop_stupid): Likewise.
* loop-unswitch.c (compare_and_jump_seq, unswitch_single_loop,
unswitch_loop): Likewise.
* loop.c (gen_prefetch, loop_optimize, rtx_equal_for_loop_p,
move_movables, replace_call_address, find_and_verify_loops,
rtx_equal_for_prefetch_p, record_giv, general_induction_var,
simplify_giv_expr, check_ext_dependent_givs, try_copy_prop,
loop_giv_dump): Likewise.
* loop.h (INSN_LUID): Likewise.
* modulo-sched.c (normalize_sched_times, generate_prolog_epilog,
sms_schedule, check_nodes_order): Likewise.
* optabs.c (gen_conditional, add_equal_note, expand_simple_binop,
expand_twoval_unop, expand_twoval_binop, expand_twoval_binop_libfunc,
expand_simple_unop, emit_no_conflict_block, prepare_cmp_insn,
emit_cmp_and_jump_insn_1, emit_cmp_and_jump_insns,
prepare_float_lib_cmp, gen_add2_insn, have_add2_insn, gen_sub2_insn,
have_sub2_insn, expand_float, expand_fix, debug_optab_libfuncs):
Likewise.
* opts.c (common_handle_option): Likewise.
* params.c (set_param_value): Likewise.
* passes.c (open_dump_file, rest_of_handle_final): Likewise.
* postreload-gcse.c (expr_equiv_p, oprs_unchanged_p,hash_scan_set,
reg_set_between_after_reload_p, reg_used_between_after_reload_p,
get_avail_load_store_reg, eliminate_partially_redundant_load):
Likewise.
* postreload.c (reload_cse_simplify_set, reload_combine_note_use):
Likewise.
* predict.c (tree_predicted_by_p, expected_value_to_br_prob,
propagate_freq, expensive_function_p): Likewise.
* pretty-print.c (pp_base_format_text)
* profile.c (instrument_edges, instrument_values,
compute_branch_probabilities, branch_prob, union_groups,
end_branch_prob, tree_register_profile_hooks): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87285 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop.c')
-rw-r--r-- | gcc/loop.c | 95 |
1 files changed, 44 insertions, 51 deletions
diff --git a/gcc/loop.c b/gcc/loop.c index 8f1ace8f1c4..188a4020c40 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -77,7 +77,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifndef HAVE_prefetch #define HAVE_prefetch 0 #define CODE_FOR_prefetch 0 -#define gen_prefetch(a,b,c) (abort(), NULL_RTX) +#define gen_prefetch(a,b,c) (gcc_unreachable(), NULL_RTX) #endif /* Give up the prefetch optimizations once we exceed a given threshold. @@ -501,8 +501,8 @@ loop_optimize (rtx f, FILE *dumpfile, int flags) /* See if we went too far. Note that get_max_uid already returns one more that the maximum uid of all insn. */ - if (get_max_uid () > max_uid_for_loop) - abort (); + gcc_assert (get_max_uid () <= max_uid_for_loop); + /* Now reset it to the actual size we need. See above. */ max_uid_for_loop = get_max_uid (); @@ -1746,7 +1746,7 @@ rtx_equal_for_loop_p (rtx x, rtx y, struct loop_movables *movables, contain anything but integers and other rtx's, except for within LABEL_REFs and SYMBOL_REFs. */ default: - abort (); + gcc_unreachable (); } } return 1; @@ -1940,21 +1940,24 @@ move_movables (struct loop *loop, struct loop_movables *movables, for (count = m->consec; count >= 0; count--) { - /* If this is the first insn of a library call sequence, - something is very wrong. */ - if (!NOTE_P (p) - && (temp = find_reg_note (p, REG_LIBCALL, NULL_RTX))) - abort (); - - /* If this is the last insn of a libcall sequence, then - delete every insn in the sequence except the last. - The last insn is handled in the normal manner. */ - if (!NOTE_P (p) - && (temp = find_reg_note (p, REG_RETVAL, NULL_RTX))) + if (!NOTE_P (p)) { - temp = XEXP (temp, 0); - while (temp != p) - temp = delete_insn (temp); + /* If this is the first insn of a library call + sequence, something is very wrong. */ + gcc_assert (!find_reg_note (p, REG_LIBCALL, + NULL_RTX)); + + /* If this is the last insn of a libcall sequence, + then delete every insn in the sequence except + the last. The last insn is handled in the + normal manner. */ + temp = find_reg_note (p, REG_RETVAL, NULL_RTX); + if (temp) + { + temp = XEXP (temp, 0); + while (temp != p) + temp = delete_insn (temp); + } } temp = p; @@ -2118,8 +2121,7 @@ move_movables (struct loop *loop, struct loop_movables *movables, << GET_MODE_BITSIZE (m->savemode))) - 1), reg, 1, OPTAB_LIB_WIDEN); - if (tem == 0) - abort (); + gcc_assert (tem != 0); if (tem != reg) emit_move_insn (reg, tem); sequence = get_insns (); @@ -2407,8 +2409,7 @@ replace_call_address (rtx x, rtx reg, rtx addr) case MEM: /* If this MEM uses a reg other than the one we expected, something is wrong. */ - if (XEXP (x, 0) != reg) - abort (); + gcc_assert (XEXP (x, 0) == reg); XEXP (x, 0) = addr; return; @@ -2723,8 +2724,7 @@ find_and_verify_loops (rtx f, struct loops *loops) break; case NOTE_INSN_LOOP_END: - if (! current_loop) - abort (); + gcc_assert (current_loop); current_loop->end = insn; current_loop = current_loop->outer; @@ -2912,6 +2912,7 @@ find_and_verify_loops (rtx f, struct loops *loops) if (invert_jump (p, new_label, 1)) { rtx q, r; + bool fail; /* If no suitable BARRIER was found, create a suitable one before TARGET. Since TARGET is a fall through @@ -2936,8 +2937,8 @@ find_and_verify_loops (rtx f, struct loops *loops) /* Include the BARRIER after INSN and copy the block after LOC. */ - if (squeeze_notes (&new_label, &last_insn_to_move)) - abort (); + fail = squeeze_notes (&new_label, &last_insn_to_move); + gcc_assert (!fail); reorder_insns (new_label, last_insn_to_move, loc); /* All those insns are now in TARGET_LOOP. */ @@ -2972,8 +2973,7 @@ find_and_verify_loops (rtx f, struct loops *loops) /* If we didn't find it, then something is wrong. */ - if (! r) - abort (); + gcc_assert (r); } /* P is now a jump outside the loop, so it must be put @@ -3683,7 +3683,7 @@ rtx_equal_for_prefetch_p (rtx x, rtx y) contain anything but integers and other rtx's, except for within LABEL_REFs and SYMBOL_REFs. */ default: - abort (); + gcc_unreachable (); } } return 1; @@ -5721,19 +5721,14 @@ record_giv (const struct loop *loop, struct induction *v, rtx insn, /* Add the giv to the class of givs computed from one biv. */ bl = REG_IV_CLASS (ivs, REGNO (src_reg)); - if (bl) - { - v->next_iv = bl->giv; - bl->giv = v; - /* Don't count DEST_ADDR. This is supposed to count the number of - insns that calculate givs. */ - if (type == DEST_REG) - bl->giv_count++; - bl->total_benefit += benefit; - } - else - /* Fatal error, biv missing for this giv? */ - abort (); + gcc_assert (bl); /* Fatal error, biv missing for this giv? */ + v->next_iv = bl->giv; + bl->giv = v; + /* Don't count DEST_ADDR. This is supposed to count the number of + insns that calculate givs. */ + if (type == DEST_REG) + bl->giv_count++; + bl->total_benefit += benefit; if (type == DEST_ADDR) { @@ -6388,7 +6383,7 @@ general_induction_var (const struct loop *loop, rtx x, rtx *src_reg, break; default: - abort (); + gcc_unreachable (); } /* Remove any enclosing USE from ADD_VAL and MULT_VAL (there will be @@ -6507,7 +6502,7 @@ simplify_giv_expr (const struct loop *loop, rtx x, rtx *ext_val, int *benefit) ext_val, benefit); default: - abort (); + gcc_unreachable (); } /* Each argument must be either REG, PLUS, or MULT. Convert REG to @@ -6648,7 +6643,7 @@ simplify_giv_expr (const struct loop *loop, rtx x, rtx *ext_val, int *benefit) ext_val, benefit); default: - abort (); + gcc_unreachable (); } case ASHIFT: @@ -7400,7 +7395,7 @@ check_ext_dependent_givs (const struct loop *loop, struct iv_class *bl) break; default: - abort (); + gcc_unreachable (); } if (ok) @@ -10040,8 +10035,7 @@ try_copy_prop (const struct loop *loop, rtx replacement, unsigned int regno) && REG_P (SET_DEST (set)) && REGNO (SET_DEST (set)) == regno) { - if (init_insn) - abort (); + gcc_assert (!init_insn); init_insn = insn; if (REGNO_FIRST_UID (regno) == INSN_UID (insn)) @@ -10074,8 +10068,7 @@ try_copy_prop (const struct loop *loop, rtx replacement, unsigned int regno) } } } - if (! init_insn) - abort (); + gcc_assert (init_insn); if (apply_change_group ()) { if (loop_dump_stream) @@ -10576,7 +10569,7 @@ loop_giv_dump (const struct induction *v, FILE *file, int verbose) fprintf (file, " ext tr"); break; default: - abort (); + gcc_unreachable (); } } |