summaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-09 17:19:16 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-09 17:19:16 +0000
commit04e579b6fdd5e00f2367ee4282d097bee5efeadc (patch)
tree4493ed2091b537830e81c4e1100321bb065757b7 /gcc/stmt.c
parent197e583ae4f10a38714ff799141b8a94cbfb89d8 (diff)
downloadgcc-04e579b6fdd5e00f2367ee4282d097bee5efeadc.tar.gz
* ra-build.c (copy_insn_p, remember_move, defuse_overlap_p_1,
live_out_1, prune_hardregs_for_mode, init_one_web_common, reinit_one_web, add_subweb, add_subweb_2, init_web_parts, record_conflict, compare_and_free_webs, init_webs_defs_uses, parts_to_webs_1, parts_to_webs, reset_conflicts, check_conflict_numbers, remember_web_was_spilled, handle_asm_insn, ra_build_free): Use gcc_assert and gcc_unreachable instead of abort. * ra-colorize.c (push_list, put_web, reset_lists, put_web_at_end, put_move, remove_move, combine, select_spill, colorize_one_web, try_recolor_web, insert_coalesced_conflicts, check_colors, break_precolored_alias, restore_conflicts_from_coalesce, sort_and_combine_web_pairs, check_uncoalesced_moves): Likewise. * ra-rewrite.c (spill_coalescing, slots_overlap_p, emit_loads, reloads_to_loads, rewrite_program2, emit_colors): Likewise. * ra.c (first_hard_reg, create_insn_info, find_subweb, init_ra, check_df): Likewise. * real.c (do_add, do_multiply, do_divide, do_compare, do_fix_trunc, real_arithmetic, real_compare, real_exponent, real_ldexp, real_identical, real_to_integer, real_to_integer2, real_to_decimal, real_to_hexadecimal, real_from_integer, ten_to_ptwo, ten_to_mptwo, real_digit, real_nan, real_maxval, round_for_format, real_convert, real_to_target, real_from_target, real_hash, encode_ieee_single, encode_ieee_double, encode_ieee_extended, encode_ieee_quad, encode_vax_f, encode_vax_d, encode_vax_g, encode_i370_single, encode_i370_double, encode_c4x_single, encode_c4x_extended): Likewise. * recog.c (validate_change, validate_replace_rtx_1, asm_operand_ok, extract_insn, peep2_next_insn, peep2_reg_dead_p, peep2_find_free_register, peephole2_optimize, store_data_bypass_p, if_test_bypass_p): Likewise. * reg-stack.c (record_label_references, get_asm_operand_n_inputs, stack_result, remove_regno_note, get_hard_regnum, emit_pop_insn, emit_swap_insn, swap_to_top, move_for_stack_reg, subst_stack_regs_pat, subst_asm_stack_regs, change_stack, compensate_edge, convert_regs_1): Likewise. * regclass.c (init_reg_sets, init_reg_sets_1, memory_move_secondary_cost): Likewise. * regrename.c (note_sets, clear_dead_regs, scan_rtx_reg, scan_rtx): Likewise. * reload.c (push_secondary_reload, find_valid_class, push_reload, operands_match_p, decompose, immune_p, find_reloads, find_reloads_toplev, find_reloads_address_1, subst_reloads, copy_replacements, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p): Likewise. * reload1.c (compute_use_by_pseudos, replace_pseudos_in, reload, count_pseudo, find_reg, eliminate_regs, eliminate_regs_in_insn, verify_initial_elim_offsets, finish_spills, clear_reload_reg_in_use, reload_reg_free_p, reload_reg_reaches_end_p, reloads_conflict, choose_reload_regs, merge_assigned_reloads, emit_input_reload_insns, do_output_reload, fixup_abnormal_edges): Likewise. * reorg.c (stop_search_p, emit_delay_sequence, get_jump_flags, fill_slots_from_thread, relax_delay_slots): Likewise. * resource.c (mark_referenced_resources, mark_set_resources): Likewise. * rtl.c (copy_rtx, rtx_equal_p): Likewise. * rtlanal.c (insn_dependent_p, reg_overlap_mentioned_p, dead_or_set_p, find_reg_fusage, remove_note, replace_rtx, subreg_lsb_1, subreg_regno_offset, subreg_offset_representable_p, find_first_parameter_load, can_hoist_insn_p, hoist_update_store, hoist_insn_after, hoist_insn_to_edge, nonzero_bits1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sbitmap.c (sbitmap_difference): Likewise. * sched-deps.c (add_dependence, sched_analyze_1, sched_analyze_2, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, schedule_ebb): Likewise. * sched-rgn.c (debug_regions, compute_trg_info, schedule_region, schedule_insns): Likewise. * sched-vis.c (print_pattern): Likewise. * sdbout.c (sdbout_symbol, sdbout_toplevel_data): Likewise. * simplify-rtx.c (simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_ternary_operation, simplify_immed_subreg, simplify_subreg, simplify_gen_subreg): Likewise. * sreal.c (copy, sreal_sub, sreal_div): Likewise. * stmt.c (force_label_rtx, expand_goto, expand_asm_operands, resolve_operand_name_1, expand_return, expand_decl, expand_anon_union_decl, emit_case_bit_tests, expand_case): Likewise. * stor-layout.c (put_pending_size, smallest_mode_for_size, int_mode_for_mode, layout_decl, finish_builtin_struct, layout_type, set_sizetype, get_mode_bounds): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87244 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c102
1 files changed, 45 insertions, 57 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 02e6664b82c..dc2ca0d3b1b 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -132,8 +132,7 @@ static struct case_node *add_case_node (struct case_node *, tree, tree, tree);
rtx
label_rtx (tree label)
{
- if (TREE_CODE (label) != LABEL_DECL)
- abort ();
+ gcc_assert (TREE_CODE (label) == LABEL_DECL);
if (!DECL_RTL_SET_P (label))
{
@@ -155,8 +154,7 @@ force_label_rtx (tree label)
tree function = decl_function_context (label);
struct function *p;
- if (!function)
- abort ();
+ gcc_assert (function);
if (function != current_function_decl)
p = find_function_data (function);
@@ -241,8 +239,7 @@ expand_goto (tree label)
/* Check for a nonlocal goto to a containing function. Should have
gotten translated to __builtin_nonlocal_goto. */
tree context = decl_function_context (label);
- if (context != 0 && context != current_function_decl)
- abort ();
+ gcc_assert (!context || context == current_function_decl);
#endif
emit_jump (label_rtx (label));
@@ -785,11 +782,12 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
bool allows_reg;
bool allows_mem;
rtx op;
+ bool ok;
- if (!parse_output_constraint (&constraints[i], i, ninputs,
+ ok = parse_output_constraint (&constraints[i], i, ninputs,
noutputs, &allows_mem, &allows_reg,
- &is_inout))
- abort ();
+ &is_inout);
+ gcc_assert (ok);
/* If an output operand is not a decl or indirect ref and our constraint
allows a register, make a temporary to act as an intermediate.
@@ -866,11 +864,12 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
const char *constraint;
tree val, type;
rtx op;
+ bool ok;
constraint = constraints[i + noutputs];
- if (! parse_input_constraint (&constraint, i, ninputs, noutputs, ninout,
- constraints, &allows_mem, &allows_reg))
- abort ();
+ ok = parse_input_constraint (&constraint, i, ninputs, noutputs, ninout,
+ constraints, &allows_mem, &allows_reg);
+ gcc_assert (ok);
generating_concat_p = 0;
@@ -1330,8 +1329,7 @@ resolve_operand_name_1 (char *p, tree outputs, tree inputs)
p = strchr (p, '\0');
/* Verify the no extra buffer space assumption. */
- if (p > q)
- abort ();
+ gcc_assert (p <= q);
/* Shift the rest of the buffer down to fill the gap. */
memmove (p, q + 1, strlen (q + 1) + 1);
@@ -1733,9 +1731,8 @@ expand_return (tree retval)
if (GET_MODE_SIZE (tmpmode) >= bytes)
break;
- /* No suitable mode found. */
- if (tmpmode == VOIDmode)
- abort ();
+ /* A suitable mode should have been found. */
+ gcc_assert (tmpmode != VOIDmode);
PUT_MODE (result_rtl, tmpmode);
}
@@ -1974,9 +1971,8 @@ expand_decl (tree decl)
to the proper address. */
if (DECL_RTL_SET_P (decl))
{
- if (!MEM_P (DECL_RTL (decl))
- || !REG_P (XEXP (DECL_RTL (decl), 0)))
- abort ();
+ gcc_assert (MEM_P (DECL_RTL (decl)));
+ gcc_assert (REG_P (XEXP (DECL_RTL (decl), 0)));
oldaddr = XEXP (DECL_RTL (decl), 0);
}
@@ -2122,6 +2118,7 @@ expand_anon_union_decl (tree decl, tree cleanup ATTRIBUTE_UNUSED,
{
tree decl_elt = TREE_VALUE (t);
enum machine_mode mode = TYPE_MODE (TREE_TYPE (decl_elt));
+ rtx decl_rtl;
/* If any of the elements are addressable, so is the entire
union. */
@@ -2139,24 +2136,18 @@ expand_anon_union_decl (tree decl, tree cleanup ATTRIBUTE_UNUSED,
DECL_MODE (decl_elt) = mode
= mode_for_size_tree (DECL_SIZE (decl_elt), MODE_INT, 1);
- /* (SUBREG (MEM ...)) at RTL generation time is invalid, so we
- instead create a new MEM rtx with the proper mode. */
- if (MEM_P (x))
+ if (mode == GET_MODE (x))
+ decl_rtl = x;
+ else if (MEM_P (x))
+ /* (SUBREG (MEM ...)) at RTL generation time is invalid, so we
+ instead create a new MEM rtx with the proper mode. */
+ decl_rtl = adjust_address_nv (x, mode, 0);
+ else
{
- if (mode == GET_MODE (x))
- SET_DECL_RTL (decl_elt, x);
- else
- SET_DECL_RTL (decl_elt, adjust_address_nv (x, mode, 0));
+ gcc_assert (REG_P (x));
+ decl_rtl = gen_lowpart_SUBREG (mode, x);
}
- else if (REG_P (x))
- {
- if (mode == GET_MODE (x))
- SET_DECL_RTL (decl_elt, x);
- else
- SET_DECL_RTL (decl_elt, gen_lowpart_SUBREG (mode, x));
- }
- else
- abort ();
+ SET_DECL_RTL (decl_elt, decl_rtl);
}
}
@@ -2280,10 +2271,9 @@ emit_case_bit_tests (tree index_type, tree index_expr, tree minval,
if (i == count)
{
- if (count >= MAX_CASE_BIT_TESTS)
- abort ();
- test[i].hi = 0;
- test[i].lo = 0;
+ gcc_assert (count < MAX_CASE_BIT_TESTS);
+ test[i].hi = 0;
+ test[i].lo = 0;
test[i].label = label;
test[i].bits = 1;
count++;
@@ -2378,8 +2368,8 @@ expand_case (tree exp)
/* The switch body is lowered in gimplify.c, we should never have
switches with a non-NULL SWITCH_BODY here. */
- if (SWITCH_BODY (exp) || !SWITCH_LABELS (exp))
- abort ();
+ gcc_assert (!SWITCH_BODY (exp));
+ gcc_assert (SWITCH_LABELS (exp));
for (i = TREE_VEC_LENGTH (vec); --i >= 0; )
{
@@ -2388,15 +2378,12 @@ expand_case (tree exp)
/* Handle default labels specially. */
if (!CASE_HIGH (elt) && !CASE_LOW (elt))
{
-#ifdef ENABLE_CHECKING
- if (default_label_decl != 0)
- abort ();
-#endif
- default_label_decl = CASE_LABEL (elt);
+ gcc_assert (!default_label_decl);
+ default_label_decl = CASE_LABEL (elt);
}
else
case_list = add_case_node (case_list, CASE_LOW (elt), CASE_HIGH (elt),
- CASE_LABEL (elt));
+ CASE_LABEL (elt));
}
do_pending_stack_adjust ();
@@ -2411,6 +2398,8 @@ expand_case (tree exp)
/* An ERROR_MARK occurs for various reasons including invalid data type. */
if (index_type != error_mark_node)
{
+ int fail;
+
/* If we don't have a default-label, create one here,
after the body of the switch. */
if (default_label_decl == 0)
@@ -2431,10 +2420,8 @@ expand_case (tree exp)
for (n = case_list; n; n = n->right)
{
/* Check low and high label values are integers. */
- if (TREE_CODE (n->low) != INTEGER_CST)
- abort ();
- if (TREE_CODE (n->high) != INTEGER_CST)
- abort ();
+ gcc_assert (TREE_CODE (n->low) == INTEGER_CST);
+ gcc_assert (TREE_CODE (n->high) == INTEGER_CST);
n->low = convert (index_type, n->low);
n->high = convert (index_type, n->high);
@@ -2605,6 +2592,7 @@ expand_case (tree exp)
if (! try_casesi (index_type, index_expr, minval, range,
table_label, default_label))
{
+ bool ok;
index_type = integer_type_node;
/* Index jumptables from zero for suitable values of
@@ -2617,9 +2605,9 @@ expand_case (tree exp)
range = maxval;
}
- if (! try_tablejump (index_type, index_expr, minval, range,
- table_label, default_label))
- abort ();
+ ok = try_tablejump (index_type, index_expr, minval, range,
+ table_label, default_label);
+ gcc_assert (ok);
}
/* Get table of labels to jump to, in order of case index. */
@@ -2675,8 +2663,8 @@ expand_case (tree exp)
before_case = NEXT_INSN (before_case);
end = get_last_insn ();
- if (squeeze_notes (&before_case, &end))
- abort ();
+ fail = squeeze_notes (&before_case, &end);
+ gcc_assert (!fail);
reorder_insns (before_case, end, start);
}