Commit 5b0264cb by Nathan Sidwell

emit-rtl.c (immed_double_const): Use gcc_assert and gcc_unreachable.

	* emit-rtl.c (immed_double_const): Use gcc_assert and gcc_unreachable.
	(gen_rtx_SUBREG, gen_reg_rtx, mark_user_reg, subreg_hard_regno,
	gen_lowpart_common, gen_highpart, gen_highpart_mode,
	subreg_highpart_offset, operand_subword, operand_subword_force,
	mem_expr_equal_p, set_mem_attributes_minus_bitpos,
	set_mem_alias_set, change_address_1, verify_rtx_sharing,
	copy_most_rtx, set_first_insn, set_last_insn, prev_cc0_setter,
	try_split, add_insn_after, add_insn_before, remove_insn,
	remove_unnecessary_notes, emit_insn_before, emit_jump_insn_before,
	emit_call_insn_before, emit_insn_after, emit_jump_insn_after,
	emit_call_insn_after, emit_insn, emit_jump_insn, emit_call_insn,
	set_unique_reg_note, emit, push_to_full_sequence, copy_insn_1,
	gen_const_vector_0, emit_copy_of_insn_after): Likewise.
	* et-forest.c (set_prev, set_next, et_check_occ_sanity,
	record_path_before_1, check_path_after_1, check_path_after): Likewise.
	* except.c (gen_eh_region, resolve_one_fixup_region,
	remove_unreachable_regions, convert_from_eh_region_ranges_1,
	add_ehl_entry, duplicate_eh_region_1, build_post_landing_pads,
	connect_post_landing_pads, sjlj_emit_function_exit,
	remove_exception_handler_label, remove_eh_handler,
	reachable_next_level, collect_one_action_chain,
	output_function_exception_table): Likewise.
	* explow.c (trunc_int_for_mode, copy_to_mode_reg,
	optimize_save_area_alloca, allocate_dynamic_stack_space,
	probe_stack_range, hard_function_value): Likewise.
	* expmed.c (mode_for_extraction, store_bit_field,
	store_fixed_bit_field, extract_bit_field, expand_shift,
	expand_mult_const, expand_mult, choose_multiplier,
	expand_mult_highpart, expand_divmod, emit_store_flag,
	do_cmp_and_jump): Likewise.
	* expr.c (convert_move, convert_modes, move_by_pieces,
	move_by_pieces_ninsns, move_by_pieces_1, emit_block_move,
	move_block_from_reg, gen_group_rtx, emit_group_load,
	emit_group_move, emit_group_store, use_reg, use_regs,
	can_store_by_pieces, store_by_pieces, store_by_pieces_1,
	emit_move_insn, emit_move_insn_1, emit_push_insn,
	expand_assignment, store_expr, count_type_elements,
	store_constructor, store_field, safe_from_p, expand_var,
	expand_expr_addr_expr, expand_expr_real_1, do_store_flag): Likewise.

From-SVN: r87178
parent ced3f397
2004-09-08 Nathan Sidwell <nathan@codesourcery.com>
* emit-rtl.c (immed_double_const): Use gcc_assert and gcc_unreachable.
(gen_rtx_SUBREG, gen_reg_rtx, mark_user_reg, subreg_hard_regno,
gen_lowpart_common, gen_highpart, gen_highpart_mode,
subreg_highpart_offset, operand_subword, operand_subword_force,
mem_expr_equal_p, set_mem_attributes_minus_bitpos,
set_mem_alias_set, change_address_1, verify_rtx_sharing,
copy_most_rtx, set_first_insn, set_last_insn, prev_cc0_setter,
try_split, add_insn_after, add_insn_before, remove_insn,
remove_unnecessary_notes, emit_insn_before, emit_jump_insn_before,
emit_call_insn_before, emit_insn_after, emit_jump_insn_after,
emit_call_insn_after, emit_insn, emit_jump_insn, emit_call_insn,
set_unique_reg_note, emit, push_to_full_sequence, copy_insn_1,
gen_const_vector_0, emit_copy_of_insn_after): Likewise.
* et-forest.c (set_prev, set_next, et_check_occ_sanity,
record_path_before_1, check_path_after_1, check_path_after): Likewise.
* except.c (gen_eh_region, resolve_one_fixup_region,
remove_unreachable_regions, convert_from_eh_region_ranges_1,
add_ehl_entry, duplicate_eh_region_1, build_post_landing_pads,
connect_post_landing_pads, sjlj_emit_function_exit,
remove_exception_handler_label, remove_eh_handler,
reachable_next_level, collect_one_action_chain,
output_function_exception_table): Likewise.
* explow.c (trunc_int_for_mode, copy_to_mode_reg,
optimize_save_area_alloca, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (mode_for_extraction, store_bit_field,
store_fixed_bit_field, extract_bit_field, expand_shift,
expand_mult_const, expand_mult, choose_multiplier,
expand_mult_highpart, expand_divmod, emit_store_flag,
do_cmp_and_jump): Likewise.
* expr.c (convert_move, convert_modes, move_by_pieces,
move_by_pieces_ninsns, move_by_pieces_1, emit_block_move,
move_block_from_reg, gen_group_rtx, emit_group_load,
emit_group_move, emit_group_store, use_reg, use_regs,
can_store_by_pieces, store_by_pieces, store_by_pieces_1,
emit_move_insn, emit_move_insn_1, emit_push_insn,
expand_assignment, store_expr, count_type_elements,
store_constructor, store_field, safe_from_p, expand_var,
expand_expr_addr_expr, expand_expr_real_1, do_store_flag): Likewise.
2004-09-08 Nathan Sidwell <nathan@codesourcery.com>
* dbxout.c (dbxout_type, dbxout_type_name, dbxout_symbol): Use
gcc_assert and gcc_unreachable.
* ddg.c (create_ddg_dependence, add_deps_for_def,
......@@ -6066,7 +6108,7 @@
* config/i386/xmmintrin.h: Include <mm_malloc.h>.
2004-08-03 H.J. Lu <hongjiu.lu@intel.com>
Tanguy Fautrà <tfautre@pandora.be>
Tanguy Fautr <tfautre@pandora.be>
* config/i386/pmm_malloc.h: New file.
......
......@@ -88,8 +88,7 @@ static inline void
set_prev (struct et_occ *occ, struct et_occ *t)
{
#ifdef DEBUG_ET
if (occ == t)
abort ();
gcc_assert (occ != t);
#endif
occ->prev = t;
......@@ -103,8 +102,7 @@ static inline void
set_next (struct et_occ *occ, struct et_occ *t)
{
#ifdef DEBUG_ET
if (occ == t)
abort ();
gcc_assert (occ != t);
#endif
occ->next = t;
......@@ -145,40 +143,26 @@ et_check_occ_sanity (struct et_occ *occ)
if (!occ)
return;
if (occ->parent == occ)
abort ();
if (occ->prev == occ)
abort ();
if (occ->next == occ)
abort ();
if (occ->next && occ->next == occ->prev)
abort ();
gcc_assert (occ->parent != occ);
gcc_assert (occ->prev != occ);
gcc_assert (occ->next != occ);
gcc_assert (!occ->next || occ->next != occ->prev);
if (occ->next)
{
if (occ->next == occ->parent)
abort ();
if (occ->next->parent != occ)
abort ();
gcc_assert (occ->next != occ->parent);
gcc_assert (occ->next->parent == occ);
}
if (occ->prev)
{
if (occ->prev == occ->parent)
abort ();
if (occ->prev->parent != occ)
abort ();
gcc_assert (occ->prev != occ->parent);
gcc_assert (occ->prev->parent == occ);
}
if (occ->parent
&& occ->parent->prev != occ
&& occ->parent->next != occ)
abort ();
gcc_assert (!occ->parent
|| occ->parent->prev == occ
|| occ->parent->next == occ);
}
/* Checks whether tree rooted at OCC is sane. */
......@@ -233,8 +217,7 @@ record_path_before_1 (struct et_occ *occ, int depth)
fprintf (stderr, "%d (%d); ", ((basic_block) occ->of->data)->index, depth);
if (len >= MAX_NODES)
abort ();
gcc_assert (len < MAX_NODES);
depths[len] = depth;
datas[len] = occ->of;
......@@ -247,8 +230,7 @@ record_path_before_1 (struct et_occ *occ, int depth)
mn = m;
}
if (mn != occ->min + depth - occ->depth)
abort ();
gcc_assert (mn == occ->min + depth - occ->depth);
return mn;
}
......@@ -285,9 +267,7 @@ check_path_after_1 (struct et_occ *occ, int depth)
}
len--;
if (depths[len] != depth
|| datas[len] != occ->of)
abort ();
gcc_assert (depths[len] == depth && datas[len] == occ->of);
if (occ->prev)
{
......@@ -296,8 +276,7 @@ check_path_after_1 (struct et_occ *occ, int depth)
mn = m;
}
if (mn != occ->min + depth - occ->depth)
abort ();
gcc_assert (mn == occ->min + depth - occ->depth);
return mn;
}
......@@ -312,8 +291,7 @@ check_path_after (struct et_occ *occ)
occ = occ->parent;
check_path_after_1 (occ, 0);
if (len != 0)
abort ();
gcc_assert (!len);
}
#endif
......
......@@ -460,8 +460,7 @@ gen_eh_region (enum eh_region_type type, struct eh_region *outer)
struct eh_region *new;
#ifdef ENABLE_CHECKING
if (! doing_eh (0))
abort ();
gcc_assert (doing_eh (0));
#endif
/* Insert a new blank region as a leaf in the tree. */
......@@ -688,8 +687,7 @@ resolve_one_fixup_region (struct eh_region *fixup)
&& cleanup->u.cleanup.exp == fixup->u.fixup.cleanup_exp)
break;
}
if (j > n)
abort ();
gcc_assert (j <= n);
real = cleanup->outer;
if (real && real->type == ERT_FIXUP)
......@@ -811,14 +809,12 @@ remove_unreachable_regions (rtx insns)
if (r->resume)
{
if (uid_region_num[INSN_UID (r->resume)])
abort ();
gcc_assert (!uid_region_num[INSN_UID (r->resume)]);
uid_region_num[INSN_UID (r->resume)] = i;
}
if (r->label)
{
if (uid_region_num[INSN_UID (r->label)])
abort ();
gcc_assert (!uid_region_num[INSN_UID (r->label)]);
uid_region_num[INSN_UID (r->label)] = i;
}
}
......@@ -942,8 +938,7 @@ convert_from_eh_region_ranges_1 (rtx *pinsns, int *orig_sp, int cur)
}
}
if (sp != orig_sp)
abort ();
gcc_assert (sp == orig_sp);
}
static void
......@@ -1006,8 +1001,7 @@ add_ehl_entry (rtx label, struct eh_region *region)
label. After landing pad creation, the exception handlers may
share landing pads. This is ok, since maybe_remove_eh_handler
only requires the 1-1 mapping before landing pad creation. */
if (*slot && !cfun->eh->built_landing_pads)
abort ();
gcc_assert (!*slot || cfun->eh->built_landing_pads);
*slot = entry;
}
......@@ -1104,7 +1098,7 @@ duplicate_eh_region_1 (struct eh_region *o, struct inline_remap *map)
n->u.throw.type = o->u.throw.type;
default:
abort ();
gcc_unreachable ();
}
if (o->label)
......@@ -1112,8 +1106,7 @@ duplicate_eh_region_1 (struct eh_region *o, struct inline_remap *map)
if (o->resume)
{
n->resume = map->insn_map[INSN_UID (o->resume)];
if (n->resume == NULL)
abort ();
gcc_assert (n->resume);
}
return n;
......@@ -1586,7 +1579,7 @@ build_post_landing_pads (void)
break;
default:
abort ();
gcc_unreachable ();
}
}
}
......@@ -1657,8 +1650,7 @@ connect_post_landing_pads (void)
end_sequence ();
barrier = emit_insn_before (seq, region->resume);
/* Avoid duplicate barrier. */
if (!BARRIER_P (barrier))
abort ();
gcc_assert (BARRIER_P (barrier));
delete_insn (barrier);
delete_insn (region->resume);
......@@ -2049,8 +2041,7 @@ sjlj_emit_function_exit (void)
/* Figure out whether the place we are supposed to insert libcall
is inside the last basic block or after it. In the other case
we need to emit to edge. */
if (e->src->next_bb != EXIT_BLOCK_PTR)
abort ();
gcc_assert (e->src->next_bb == EXIT_BLOCK_PTR);
for (insn = NEXT_INSN (BB_END (e->src)); insn; insn = NEXT_INSN (insn))
if (insn == cfun->eh->sjlj_exit_after)
break;
......@@ -2258,8 +2249,7 @@ remove_exception_handler_label (rtx label)
tmp.label = label;
slot = (struct ehl_map_entry **)
htab_find_slot (cfun->eh->exception_handler_label_map, &tmp, NO_INSERT);
if (! slot)
abort ();
gcc_assert (slot);
htab_clear_slot (cfun->eh->exception_handler_label_map, (void **) slot);
}
......@@ -2330,8 +2320,7 @@ remove_eh_handler (struct eh_region *region)
try->type == ERT_CATCH;
try = try->next_peer)
continue;
if (try->type != ERT_TRY)
abort ();
gcc_assert (try->type == ERT_TRY);
next = region->u.catch.next_catch;
prev = region->u.catch.prev_catch;
......@@ -2642,10 +2631,11 @@ reachable_next_level (struct eh_region *region, tree type_thrown,
case ERT_FIXUP:
case ERT_UNKNOWN:
/* Shouldn't see these here. */
gcc_unreachable ();
break;
default:
gcc_unreachable ();
}
abort ();
}
/* Invoke CALLBACK on each region reachable from REGION_NUMBER. */
......@@ -3259,7 +3249,7 @@ collect_one_action_chain (htab_t ar_hash, struct eh_region *region)
return collect_one_action_chain (ar_hash, region->outer);
default:
abort ();
gcc_unreachable ();
}
}
......@@ -3763,8 +3753,8 @@ output_function_exception_table (void)
cgraph_varpool_mark_needed_node (node);
}
}
else if (TREE_CODE (type) != INTEGER_CST)
abort ();
else
gcc_assert (TREE_CODE (type) == INTEGER_CST);
}
if (tt_format == DW_EH_PE_absptr || tt_format == DW_EH_PE_aligned)
......
......@@ -50,8 +50,7 @@ trunc_int_for_mode (HOST_WIDE_INT c, enum machine_mode mode)
int width = GET_MODE_BITSIZE (mode);
/* You want to truncate to a _what_? */
if (! SCALAR_INT_MODE_P (mode))
abort ();
gcc_assert (SCALAR_INT_MODE_P (mode));
/* Canonicalize BImode to 0 and STORE_FLAG_VALUE. */
if (mode == BImode)
......@@ -633,8 +632,7 @@ copy_to_mode_reg (enum machine_mode mode, rtx x)
if (! general_operand (x, VOIDmode))
x = force_operand (x, temp);
if (GET_MODE (x) != mode && GET_MODE (x) != VOIDmode)
abort ();
gcc_assert (GET_MODE (x) == mode || GET_MODE (x) == VOIDmode);
if (x != temp)
emit_move_insn (temp, x);
return temp;
......@@ -1106,11 +1104,10 @@ optimize_save_area_alloca (void)
Right now only supported port with stack that grow upward
is the HPPA and it does not define SETJMP_VIA_SAVE_AREA. */
if (GET_CODE (pat) != SET
|| SET_DEST (pat) != stack_pointer_rtx
|| GET_CODE (SET_SRC (pat)) != MINUS
|| XEXP (SET_SRC (pat), 0) != stack_pointer_rtx)
abort ();
gcc_assert (GET_CODE (pat) == SET
&& SET_DEST (pat) == stack_pointer_rtx
&& GET_CODE (SET_SRC (pat)) == MINUS
&& XEXP (SET_SRC (pat), 0) == stack_pointer_rtx);
/* This will now be transformed into a (set REG REG)
so we can just blow away all the other notes. */
......@@ -1134,8 +1131,7 @@ optimize_save_area_alloca (void)
if (XEXP (srch, 1) == note)
break;
if (srch == NULL_RTX)
abort ();
gcc_assert (srch);
XEXP (srch, 1) = XEXP (note, 1);
}
......@@ -1229,8 +1225,7 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align)
/* ??? Code below assumes that the save area needs maximal
alignment. This constraint may be too strong. */
if (PREFERRED_STACK_BOUNDARY != BIGGEST_ALIGNMENT)
abort ();
gcc_assert (PREFERRED_STACK_BOUNDARY == BIGGEST_ALIGNMENT);
if (GET_CODE (size) == CONST_INT)
{
......@@ -1287,8 +1282,8 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align)
/* We ought to be called always on the toplevel and stack ought to be aligned
properly. */
if (stack_pointer_delta % (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT))
abort ();
gcc_assert (!(stack_pointer_delta
% (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT)));
/* If needed, check that we have the required amount of stack. Take into
account what has already been checked. */
......@@ -1539,8 +1534,7 @@ probe_stack_range (HOST_WIDE_INT first, rtx size)
1, OPTAB_WIDEN);
#endif
if (temp != test_addr)
abort ();
gcc_assert (temp == test_addr);
emit_label (test_lab);
emit_cmp_and_jump_insns (test_addr, last_addr, CMP_OPCODE,
......@@ -1594,8 +1588,7 @@ hard_function_value (tree valtype, tree func ATTRIBUTE_UNUSED,
}
/* No suitable mode found. */
if (tmpmode == VOIDmode)
abort ();
gcc_assert (tmpmode != VOIDmode);
PUT_MODE (val, tmpmode);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment