aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authorGiovanni Bajo <giovannibajo@gcc.gnu.org>2004-09-10 11:02:26 +0000
committerNathan Sidwell <nathan@codesourcery.com>2004-09-10 11:02:26 +0000
commitc94db91a9fafb1a5bb3554aa449291487471ba4d (patch)
treee64840975a1fb341da6f0ef0ef7e39e120efacf6 /gcc/optabs.c
parent5a7fc12ca67e0107e0de1f832622f4378c517d5b (diff)
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: https://gcc.gnu.org/svn/gcc/trunk@87290 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c114
1 files changed, 70 insertions, 44 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 864e813099d..cc48ab53949 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -119,7 +119,7 @@ static rtx expand_parity (enum machine_mode, rtx, rtx);
#ifndef HAVE_conditional_trap
#define HAVE_conditional_trap 0
-#define gen_conditional_trap(a,b) (gcc_unreachable (), NULL_RTX)
+#define gen_conditional_trap(a,b) (abort (), NULL_RTX)
#endif
/* Add a REG_EQUAL note to the last insn in INSNS. TARGET is being set to
@@ -138,9 +138,10 @@ add_equal_note (rtx insns, rtx target, enum rtx_code code, rtx op0, rtx op1)
rtx last_insn, insn, set;
rtx note;
- gcc_assert (insns);
- gcc_assert (INSN_P (insns));
- gcc_assert (NEXT_INSN (insns) != NULL_RTX);
+ if (! insns
+ || ! INSN_P (insns)
+ || NEXT_INSN (insns) == NULL_RTX)
+ abort ();
if (GET_RTX_CLASS (code) != RTX_COMM_ARITH
&& GET_RTX_CLASS (code) != RTX_BIN_ARITH
@@ -671,7 +672,8 @@ expand_simple_binop (enum machine_mode mode, enum rtx_code code, rtx op0,
enum optab_methods methods)
{
optab binop = code_to_optab[(int) code];
- gcc_assert (binop != 0);
+ if (binop == 0)
+ abort ();
return expand_binop (mode, binop, op0, op1, target, unsignedp, methods);
}
@@ -1710,8 +1712,9 @@ expand_twoval_unop (optab unoptab, rtx op0, rtx targ0, rtx targ1,
/* We could handle this, but we should always be called with a pseudo
for our targets and all insns should take them as outputs. */
- gcc_assert ((*insn_data[icode].operand[0].predicate) (targ0, mode));
- gcc_assert ((*insn_data[icode].operand[1].predicate) (targ1, mode));
+ if (! (*insn_data[icode].operand[0].predicate) (targ0, mode)
+ || ! (*insn_data[icode].operand[1].predicate) (targ1, mode))
+ abort ();
pat = GEN_FCN (icode) (targ0, targ1, xop0);
if (pat)
@@ -1838,8 +1841,9 @@ expand_twoval_binop (optab binoptab, rtx op0, rtx op1, rtx targ0, rtx targ1,
/* We could handle this, but we should always be called with a pseudo
for our targets and all insns should take them as outputs. */
- gcc_assert ((*insn_data[icode].operand[0].predicate) (targ0, mode));
- gcc_assert ((*insn_data[icode].operand[3].predicate) (targ1, mode));
+ if (! (*insn_data[icode].operand[0].predicate) (targ0, mode)
+ || ! (*insn_data[icode].operand[3].predicate) (targ1, mode))
+ abort ();
pat = GEN_FCN (icode) (targ0, xop0, xop1, targ1);
if (pat)
@@ -1902,7 +1906,8 @@ expand_twoval_binop_libfunc (optab binoptab, rtx op0, rtx op1,
rtx insns;
/* Exactly one of TARG0 or TARG1 should be non-NULL. */
- gcc_assert ((targ0 != NULL_RTX) ^ (targ1 != NULL_RTX));
+ if (!((targ0 != NULL_RTX) ^ (targ1 != NULL_RTX)))
+ abort ();
mode = GET_MODE (op0);
if (!binoptab->handlers[(int) mode].libfunc)
@@ -1939,7 +1944,8 @@ expand_simple_unop (enum machine_mode mode, enum rtx_code code, rtx op0,
rtx target, int unsignedp)
{
optab unop = code_to_optab[(int) code];
- gcc_assert (unop != 0);
+ if (unop == 0)
+ abort ();
return expand_unop (mode, unop, op0, target, unsignedp);
}
@@ -2614,7 +2620,8 @@ emit_no_conflict_block (rtx insns, rtx target, rtx op0, rtx op1, rtx equiv)
}
}
- gcc_assert (set != 0);
+ if (set == 0)
+ abort ();
if (! reg_overlap_mentioned_p (target, SET_DEST (set)))
{
@@ -2925,7 +2932,7 @@ prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size,
/* They could both be VOIDmode if both args are immediate constants,
but we should fold that at an earlier stage.
- With no special code here, this will assert out,
+ With no special code here, this will call abort,
reminding the programmer to implement such folding. */
if (mode != BLKmode && flag_force_mem)
@@ -2954,10 +2961,11 @@ prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size,
y = force_reg (mode, y);
#ifdef HAVE_cc0
- /* Assert out if we have a non-canonical comparison. The RTL documentation
+ /* Abort if we have a non-canonical comparison. The RTL documentation
states that canonical comparisons are required only for targets which
have cc0. */
- gcc_assert (!CONSTANT_P (x) || CONSTANT_P (y));
+ if (CONSTANT_P (x) && ! CONSTANT_P (y))
+ abort ();
#endif
/* Don't let both operands fail to indicate the mode. */
@@ -2976,7 +2984,8 @@ prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size,
rtx opalign
= GEN_INT (MIN (MEM_ALIGN (x), MEM_ALIGN (y)) / BITS_PER_UNIT);
- gcc_assert (size != 0);
+ if (size == 0)
+ abort ();
/* Try to use a memory block compare insn - either cmpstr
or cmpmem will do. */
@@ -3073,8 +3082,11 @@ prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size,
return;
}
- gcc_assert (class == MODE_FLOAT);
- prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp);
+ if (class == MODE_FLOAT)
+ prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp);
+
+ else
+ abort ();
}
/* Before emitting an insn with code ICODE, make sure that X, which is going
@@ -3114,7 +3126,7 @@ emit_cmp_and_jump_insn_1 (rtx x, rtx y, enum machine_mode mode,
enum machine_mode wider_mode = mode;
/* Try combined insns first. */
- for (;;)
+ do
{
enum insn_code icode;
PUT_MODE (test, wider_mode);
@@ -3157,12 +3169,15 @@ emit_cmp_and_jump_insn_1 (rtx x, rtx y, enum machine_mode mode,
return;
}
- gcc_assert (class == MODE_INT || class == MODE_FLOAT
- || class == MODE_COMPLEX_FLOAT);
+ if (class != MODE_INT && class != MODE_FLOAT
+ && class != MODE_COMPLEX_FLOAT)
+ break;
wider_mode = GET_MODE_WIDER_MODE (wider_mode);
- gcc_assert (wider_mode != VOIDmode);
}
+ while (wider_mode != VOIDmode);
+
+ abort ();
}
/* Generate code to compare X with Y so that the condition codes are
@@ -3193,7 +3208,8 @@ emit_cmp_and_jump_insns (rtx x, rtx y, enum rtx_code comparison, rtx size,
{
/* If we're not emitting a branch, this means some caller
is out of sync. */
- gcc_assert (label);
+ if (! label)
+ abort ();
op0 = y, op1 = x;
comparison = swap_condition (comparison);
@@ -3264,7 +3280,8 @@ prepare_float_lib_cmp (rtx *px, rtx *py, enum rtx_code *pcomparison,
}
}
- gcc_assert (mode != VOIDmode);
+ if (mode == VOIDmode)
+ abort ();
if (mode != orig_mode)
{
@@ -3322,7 +3339,7 @@ prepare_float_lib_cmp (rtx *px, rtx *py, enum rtx_code *pcomparison,
break;
default:
- gcc_unreachable ();
+ abort ();
}
equiv = simplify_gen_ternary (IF_THEN_ELSE, word_mode, word_mode,
equiv, true_rtx, false_rtx);
@@ -3624,12 +3641,13 @@ gen_add2_insn (rtx x, rtx y)
{
int icode = (int) add_optab->handlers[(int) GET_MODE (x)].insn_code;
- gcc_assert ((*insn_data[icode].operand[0].predicate)
- (x, insn_data[icode].operand[0].mode));
- gcc_assert ((*insn_data[icode].operand[1].predicate)
- (x, insn_data[icode].operand[1].mode));
- gcc_assert ((*insn_data[icode].operand[2].predicate)
- (y, insn_data[icode].operand[2].mode));
+ if (! ((*insn_data[icode].operand[0].predicate)
+ (x, insn_data[icode].operand[0].mode))
+ || ! ((*insn_data[icode].operand[1].predicate)
+ (x, insn_data[icode].operand[1].mode))
+ || ! ((*insn_data[icode].operand[2].predicate)
+ (y, insn_data[icode].operand[2].mode)))
+ abort ();
return (GEN_FCN (icode) (x, x, y));
}
@@ -3658,7 +3676,8 @@ have_add2_insn (rtx x, rtx y)
{
int icode;
- gcc_assert (GET_MODE (x) != VOIDmode);
+ if (GET_MODE (x) == VOIDmode)
+ abort ();
icode = (int) add_optab->handlers[(int) GET_MODE (x)].insn_code;
@@ -3683,12 +3702,13 @@ gen_sub2_insn (rtx x, rtx y)
{
int icode = (int) sub_optab->handlers[(int) GET_MODE (x)].insn_code;
- gcc_assert ((*insn_data[icode].operand[0].predicate)
- (x, insn_data[icode].operand[0].mode));
- gcc_assert ((*insn_data[icode].operand[1].predicate)
- (x, insn_data[icode].operand[1].mode));
- gcc_assert ((*insn_data[icode].operand[2].predicate)
- (y, insn_data[icode].operand[2].mode));
+ if (! ((*insn_data[icode].operand[0].predicate)
+ (x, insn_data[icode].operand[0].mode))
+ || ! ((*insn_data[icode].operand[1].predicate)
+ (x, insn_data[icode].operand[1].mode))
+ || ! ((*insn_data[icode].operand[2].predicate)
+ (y, insn_data[icode].operand[2].mode)))
+ abort ();
return (GEN_FCN (icode) (x, x, y));
}
@@ -3717,7 +3737,8 @@ have_sub2_insn (rtx x, rtx y)
{
int icode;
- gcc_assert (GET_MODE (x) != VOIDmode);
+ if (GET_MODE (x) == VOIDmode)
+ abort ();
icode = (int) sub_optab->handlers[(int) GET_MODE (x)].insn_code;
@@ -3843,7 +3864,8 @@ expand_float (rtx to, rtx from, int unsignedp)
enum machine_mode fmode, imode;
/* Crash now, because we won't be able to decide which mode to use. */
- gcc_assert (GET_MODE (from) != VOIDmode);
+ if (GET_MODE (from) == VOIDmode)
+ abort ();
/* Look for an insn to do the conversion. Do it in the specified
modes if possible; otherwise convert either input, output or both to
@@ -4004,7 +4026,8 @@ expand_float (rtx to, rtx from, int unsignedp)
from = force_not_mem (from);
libfunc = tab->handlers[GET_MODE (to)][GET_MODE (from)].libfunc;
- gcc_assert (libfunc);
+ if (!libfunc)
+ abort ();
start_sequence ();
@@ -4187,7 +4210,8 @@ expand_fix (rtx to, rtx from, int unsignedp)
convert_optab tab = unsignedp ? ufix_optab : sfix_optab;
libfunc = tab->handlers[GET_MODE (to)][GET_MODE (from)].libfunc;
- gcc_assert (libfunc);
+ if (!libfunc)
+ abort ();
if (flag_force_mem)
from = force_not_mem (from);
@@ -4800,7 +4824,8 @@ debug_optab_libfuncs (void)
h = &o->handlers[j];
if (h->libfunc)
{
- gcc_assert (GET_CODE (h->libfunc) == SYMBOL_REF);
+ if (GET_CODE (h->libfunc) != SYMBOL_REF)
+ abort ();
fprintf (stderr, "%s\t%s:\t%s\n",
GET_RTX_NAME (o->code),
GET_MODE_NAME (j),
@@ -4820,7 +4845,8 @@ debug_optab_libfuncs (void)
h = &o->handlers[j][k];
if (h->libfunc)
{
- gcc_assert (GET_CODE (h->libfunc) == SYMBOL_REF);
+ if (GET_CODE (h->libfunc) != SYMBOL_REF)
+ abort ();
fprintf (stderr, "%s\t%s\t%s:\t%s\n",
GET_RTX_NAME (o->code),
GET_MODE_NAME (j),