diff options
author | Giovanni Bajo <giovannibajo@gcc.gnu.org> | 2004-09-10 09:22:28 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-09-10 09:22:28 +0000 |
commit | 1c43d3ca812e7165d7a522d9380c394ba6d8ebd5 (patch) | |
tree | 53321caf2b610be1206b5d38f653d831c8fd72e4 /gcc/loop-iv.c | |
parent | b829f3fac7e1c736df642ace45589e8d24ae2731 (diff) | |
download | gcc-1c43d3ca812e7165d7a522d9380c394ba6d8ebd5.zip gcc-1c43d3ca812e7165d7a522d9380c394ba6d8ebd5.tar.gz gcc-1c43d3ca812e7165d7a522d9380c394ba6d8ebd5.tar.bz2 |
lambda-mat.c (lambda_matrix_inverse_hard): Use gcc_assert and gcc_unreachable instead of abort.
* 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.
From-SVN: r87285
Diffstat (limited to 'gcc/loop-iv.c')
-rw-r--r-- | gcc/loop-iv.c | 76 |
1 files changed, 31 insertions, 45 deletions
diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c index a7c43e3..6430b24 100644 --- a/gcc/loop-iv.c +++ b/gcc/loop-iv.c @@ -793,16 +793,15 @@ get_biv_step_1 (rtx insn, rtx reg, case SIGN_EXTEND: case ZERO_EXTEND: - if (GET_MODE (op0) != *inner_mode - || *extend != UNKNOWN - || *outer_step != const0_rtx) - abort (); + gcc_assert (GET_MODE (op0) == *inner_mode); + gcc_assert (*extend == UNKNOWN); + gcc_assert (*outer_step == const0_rtx); *extend = code; break; default: - abort (); + gcc_unreachable (); } return true; @@ -826,17 +825,9 @@ get_biv_step (rtx reg, rtx *inner_step, enum machine_mode *inner_mode, outer_step)) return false; - if (*inner_mode != *outer_mode - && *extend == UNKNOWN) - abort (); - - if (*inner_mode == *outer_mode - && *extend != UNKNOWN) - abort (); - - if (*inner_mode == *outer_mode - && *outer_step != const0_rtx) - abort (); + gcc_assert (*inner_mode == *outer_mode || *extend != UNKNOWN); + gcc_assert (*inner_mode != *outer_mode || *extend == UNKNOWN); + gcc_assert (*inner_mode != *outer_mode || *outer_step == const0_rtx); return true; } @@ -1085,8 +1076,7 @@ iv_analyze (rtx insn, rtx def, struct rtx_iv *iv) mby = XEXP (rhs, 1); if (!CONSTANT_P (mby)) { - if (!CONSTANT_P (op0)) - abort (); + gcc_assert (CONSTANT_P (op0)); tmp = op0; op0 = mby; mby = tmp; @@ -1094,14 +1084,13 @@ iv_analyze (rtx insn, rtx def, struct rtx_iv *iv) break; case ASHIFT: - if (CONSTANT_P (XEXP (rhs, 0))) - abort (); + gcc_assert (!CONSTANT_P (XEXP (rhs, 0))); op0 = XEXP (rhs, 0); mby = XEXP (rhs, 1); break; default: - abort (); + gcc_unreachable (); } amode = GET_MODE (rhs); @@ -1192,8 +1181,7 @@ get_iv_value (struct rtx_iv *iv, rtx iteration) /* We would need to generate some if_then_else patterns, and so far it is not needed anywhere. */ - if (iv->first_special) - abort (); + gcc_assert (!iv->first_special); if (iv->step != const0_rtx && iteration != const0_rtx) val = simplify_gen_binary (PLUS, iv->extend_mode, iv->base, @@ -1529,8 +1517,7 @@ canon_condition (rtx cond) mode = GET_MODE (op0); if (mode == VOIDmode) mode = GET_MODE (op1); - if (mode == VOIDmode) - abort (); + gcc_assert (mode != VOIDmode); if (GET_CODE (op1) == CONST_INT && GET_MODE_CLASS (mode) != MODE_CC @@ -1659,20 +1646,21 @@ simplify_using_condition (rtx cond, rtx *expr, regset altered) static void eliminate_implied_condition (enum rtx_code op, rtx a, rtx *b) { - if (op == AND) + switch (op) { + case AND: /* If A implies *B, we may replace *B by true. */ if (implies_p (a, *b)) *b = const_true_rtx; - } - else if (op == IOR) - { + break; + case IOR: /* If *B implies A, we may replace *B by false. */ if (implies_p (*b, a)) *b = const0_rtx; + break; + default: + gcc_unreachable (); } - else - abort (); } /* Eliminates the conditions in TAIL that are implied by HEAD. OP is the @@ -1714,18 +1702,19 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr) eliminate_implied_conditions (op, &head, tail); - if (op == AND) + switch (op) { + case AND: neutral = const_true_rtx; aggr = const0_rtx; - } - else if (op == IOR) - { + break; + case IOR: neutral = const0_rtx; aggr = const_true_rtx; + break; + default: + gcc_unreachable (); } - else - abort (); simplify_using_initial_values (loop, UNKNOWN, &head); if (head == aggr) @@ -1753,8 +1742,7 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr) return; } - if (op != UNKNOWN) - abort (); + gcc_assert (op == UNKNOWN); e = loop_preheader_edge (loop); if (e->src == ENTRY_BLOCK_PTR) @@ -1856,7 +1844,7 @@ shorten_into_mode (struct rtx_iv *iv, enum machine_mode mode, break; default: - abort (); + gcc_unreachable (); } iv->mode = mode; @@ -1914,7 +1902,7 @@ canonicalize_iv_subregs (struct rtx_iv *iv0, struct rtx_iv *iv1, break; default: - abort (); + gcc_unreachable (); } /* Values of both variables should be computed in the same mode. These @@ -2013,15 +2001,13 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition, desc->niter_max = 0; cond = GET_CODE (condition); - if (!COMPARISON_P (condition)) - abort (); + gcc_assert (COMPARISON_P (condition)); mode = GET_MODE (XEXP (condition, 0)); if (mode == VOIDmode) mode = GET_MODE (XEXP (condition, 1)); /* The constant comparisons should be folded. */ - if (mode == VOIDmode) - abort (); + gcc_assert (mode != VOIDmode); /* We only handle integers or pointers. */ if (GET_MODE_CLASS (mode) != MODE_INT |