summaryrefslogtreecommitdiff
path: root/gcc/loop-iv.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-10 11:02:26 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-10 11:02:26 +0000
commit2045cdd44d272c6b5330210e6a60aa16f769b850 (patch)
treee64840975a1fb341da6f0ef0ef7e39e120efacf6 /gcc/loop-iv.c
parentba03a9086d20fab11badea65d734205119b4a762 (diff)
downloadgcc-2045cdd44d272c6b5330210e6a60aa16f769b850.tar.gz
Revert 2004-09-09 Giovanni Bajo <giovannibajo@gcc.gnu.org>
* 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@87290 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop-iv.c')
-rw-r--r--gcc/loop-iv.c76
1 files changed, 45 insertions, 31 deletions
diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c
index 6430b244f71..a7c43e31508 100644
--- a/gcc/loop-iv.c
+++ b/gcc/loop-iv.c
@@ -793,15 +793,16 @@ get_biv_step_1 (rtx insn, rtx reg,
case SIGN_EXTEND:
case ZERO_EXTEND:
- gcc_assert (GET_MODE (op0) == *inner_mode);
- gcc_assert (*extend == UNKNOWN);
- gcc_assert (*outer_step == const0_rtx);
+ if (GET_MODE (op0) != *inner_mode
+ || *extend != UNKNOWN
+ || *outer_step != const0_rtx)
+ abort ();
*extend = code;
break;
default:
- gcc_unreachable ();
+ abort ();
}
return true;
@@ -825,9 +826,17 @@ get_biv_step (rtx reg, rtx *inner_step, enum machine_mode *inner_mode,
outer_step))
return false;
- 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);
+ 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 ();
return true;
}
@@ -1076,7 +1085,8 @@ iv_analyze (rtx insn, rtx def, struct rtx_iv *iv)
mby = XEXP (rhs, 1);
if (!CONSTANT_P (mby))
{
- gcc_assert (CONSTANT_P (op0));
+ if (!CONSTANT_P (op0))
+ abort ();
tmp = op0;
op0 = mby;
mby = tmp;
@@ -1084,13 +1094,14 @@ iv_analyze (rtx insn, rtx def, struct rtx_iv *iv)
break;
case ASHIFT:
- gcc_assert (!CONSTANT_P (XEXP (rhs, 0)));
+ if (CONSTANT_P (XEXP (rhs, 0)))
+ abort ();
op0 = XEXP (rhs, 0);
mby = XEXP (rhs, 1);
break;
default:
- gcc_unreachable ();
+ abort ();
}
amode = GET_MODE (rhs);
@@ -1181,7 +1192,8 @@ 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. */
- gcc_assert (!iv->first_special);
+ if (iv->first_special)
+ abort ();
if (iv->step != const0_rtx && iteration != const0_rtx)
val = simplify_gen_binary (PLUS, iv->extend_mode, iv->base,
@@ -1517,7 +1529,8 @@ canon_condition (rtx cond)
mode = GET_MODE (op0);
if (mode == VOIDmode)
mode = GET_MODE (op1);
- gcc_assert (mode != VOIDmode);
+ if (mode == VOIDmode)
+ abort ();
if (GET_CODE (op1) == CONST_INT
&& GET_MODE_CLASS (mode) != MODE_CC
@@ -1646,21 +1659,20 @@ simplify_using_condition (rtx cond, rtx *expr, regset altered)
static void
eliminate_implied_condition (enum rtx_code op, rtx a, rtx *b)
{
- switch (op)
+ if (op == AND)
{
- case AND:
/* If A implies *B, we may replace *B by true. */
if (implies_p (a, *b))
*b = const_true_rtx;
- break;
- case IOR:
+ }
+ else if (op == 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
@@ -1702,19 +1714,18 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
eliminate_implied_conditions (op, &head, tail);
- switch (op)
+ if (op == AND)
{
- case AND:
neutral = const_true_rtx;
aggr = const0_rtx;
- break;
- case IOR:
+ }
+ else if (op == IOR)
+ {
neutral = const0_rtx;
aggr = const_true_rtx;
- break;
- default:
- gcc_unreachable ();
}
+ else
+ abort ();
simplify_using_initial_values (loop, UNKNOWN, &head);
if (head == aggr)
@@ -1742,7 +1753,8 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
return;
}
- gcc_assert (op == UNKNOWN);
+ if (op != UNKNOWN)
+ abort ();
e = loop_preheader_edge (loop);
if (e->src == ENTRY_BLOCK_PTR)
@@ -1844,7 +1856,7 @@ shorten_into_mode (struct rtx_iv *iv, enum machine_mode mode,
break;
default:
- gcc_unreachable ();
+ abort ();
}
iv->mode = mode;
@@ -1902,7 +1914,7 @@ canonicalize_iv_subregs (struct rtx_iv *iv0, struct rtx_iv *iv1,
break;
default:
- gcc_unreachable ();
+ abort ();
}
/* Values of both variables should be computed in the same mode. These
@@ -2001,13 +2013,15 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition,
desc->niter_max = 0;
cond = GET_CODE (condition);
- gcc_assert (COMPARISON_P (condition));
+ if (!COMPARISON_P (condition))
+ abort ();
mode = GET_MODE (XEXP (condition, 0));
if (mode == VOIDmode)
mode = GET_MODE (XEXP (condition, 1));
/* The constant comparisons should be folded. */
- gcc_assert (mode != VOIDmode);
+ if (mode == VOIDmode)
+ abort ();
/* We only handle integers or pointers. */
if (GET_MODE_CLASS (mode) != MODE_INT