This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[assert] [lmnop]*.[ch]
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Giovanni Bajo <giovannibajo at libero dot it>
- Date: Fri, 10 Sep 2004 10:23:11 +0100
- Subject: [assert] [lmnop]*.[ch]
- Organization: Codesourcery LLC
I've installed this patch of Giovanni's that assertifies the
[lmnop]*.[ch] files.
Thank's Giovanni!
booted & tested on i686-pc-linux-gnu.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
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.
Index: lambda.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/lambda.h,v
retrieving revision 2.3
diff -c -3 -p -r2.3 lambda.h
*** lambda.h 26 Aug 2004 17:10:49 -0000 2.3
--- lambda.h 9 Sep 2004 14:23:18 -0000
*************** lambda_vector_min_nz (lambda_vector vec1
*** 290,299 ****
{
int j;
int min = -1;
! #ifdef ENABLE_CHECKING
! if (start > n)
! abort ();
! #endif
for (j = start; j < n; j++)
{
if (vec1[j])
--- 290,296 ----
{
int j;
int min = -1;
! gcc_assert (start <= n);
for (j = start; j < n; j++)
{
if (vec1[j])
*************** lambda_vector_min_nz (lambda_vector vec1
*** 301,308 ****
min = j;
}
! if (min < 0)
! abort ();
return min;
}
--- 298,304 ----
min = j;
}
! gcc_assert (min >= 0);
return min;
}
Index: lambda-mat.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/lambda-mat.c,v
retrieving revision 2.3
diff -c -3 -p -r2.3 lambda-mat.c
*** lambda-mat.c 5 Sep 2004 16:04:59 -0000 2.3
--- lambda-mat.c 9 Sep 2004 14:23:19 -0000
*************** lambda_matrix_inverse_hard (lambda_matri
*** 379,386 ****
diagonal = row[j];
/* If the matrix is singular, abort. */
! if (diagonal == 0)
! abort ();
determinant = determinant * diagonal;
--- 379,385 ----
diagonal = row[j];
/* If the matrix is singular, abort. */
! gcc_assert (diagonal != 0);
determinant = determinant * diagonal;
Index: langhooks.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/langhooks.c,v
retrieving revision 1.72
diff -c -3 -p -r1.72 langhooks.c
*** langhooks.c 27 Aug 2004 00:27:24 -0000 1.72
--- langhooks.c 9 Sep 2004 14:23:20 -0000
*************** lhd_set_decl_assembler_name (tree decl)
*** 156,193 ****
/* The language-independent code should never use the
DECL_ASSEMBLER_NAME for lots of DECLs. Only FUNCTION_DECLs and
VAR_DECLs for variables with static storage duration need a real
! DECL_ASSEMBLER_NAME. */
! if (TREE_CODE (decl) == FUNCTION_DECL
! || (TREE_CODE (decl) == VAR_DECL
! && (TREE_STATIC (decl)
! || DECL_EXTERNAL (decl)
! || TREE_PUBLIC (decl))))
{
! /* By default, assume the name to use in assembly code is the
! same as that used in the source language. (That's correct
! for C, and GCC used to set DECL_ASSEMBLER_NAME to the same
! value as DECL_NAME in build_decl, so this choice provides
! backwards compatibility with existing front-ends.
!
! Can't use just the variable's own name for a variable whose
! scope is less than the whole compilation. Concatenate a
! distinguishing number - we use the DECL_UID. */
! if (TREE_PUBLIC (decl) || DECL_CONTEXT (decl) == NULL_TREE)
! SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl));
! else
! {
! const char *name = IDENTIFIER_POINTER (DECL_NAME (decl));
! char *label;
! ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl));
! SET_DECL_ASSEMBLER_NAME (decl, get_identifier (label));
! }
}
- else
- /* Nobody should ever be asking for the DECL_ASSEMBLER_NAME of
- these DECLs -- unless they're in language-dependent code, in
- which case set_decl_assembler_name hook should handle things. */
- abort ();
}
/* By default we always allow bit-field based optimizations. */
--- 156,190 ----
/* The language-independent code should never use the
DECL_ASSEMBLER_NAME for lots of DECLs. Only FUNCTION_DECLs and
VAR_DECLs for variables with static storage duration need a real
! DECL_ASSEMBLER_NAME.
! Nobody should ever be asking for the DECL_ASSEMBLER_NAME of
! these DECLs -- unless they're in language-dependent code, in
! which case set_decl_assembler_name hook should handle things. */
! gcc_assert (TREE_CODE (decl) == FUNCTION_DECL
! || (TREE_CODE (decl) == VAR_DECL
! && (TREE_STATIC (decl)
! || DECL_EXTERNAL (decl)
! || TREE_PUBLIC (decl))));
!
! /* By default, assume the name to use in assembly code is the
! same as that used in the source language. (That's correct
! for C, and GCC used to set DECL_ASSEMBLER_NAME to the same
! value as DECL_NAME in build_decl, so this choice provides
! backwards compatibility with existing front-ends.
!
! Can't use just the variable's own name for a variable whose
! scope is less than the whole compilation. Concatenate a
! distinguishing number - we use the DECL_UID. */
! if (TREE_PUBLIC (decl) || DECL_CONTEXT (decl) == NULL_TREE)
! SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl));
! else
{
! const char *name = IDENTIFIER_POINTER (DECL_NAME (decl));
! char *label;
! ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl));
! SET_DECL_ASSEMBLER_NAME (decl, get_identifier (label));
}
}
/* By default we always allow bit-field based optimizations. */
*************** lhd_can_use_bit_fields_p (void)
*** 201,207 ****
tree
lhd_type_promotes_to (tree ARG_UNUSED (type))
{
! abort ();
}
/* Registration of machine- or os-specific builtin types. */
--- 198,204 ----
tree
lhd_type_promotes_to (tree ARG_UNUSED (type))
{
! gcc_unreachable ();
}
/* Registration of machine- or os-specific builtin types. */
*************** lhd_register_builtin_type (tree ARG_UNUS
*** 215,224 ****
void
lhd_incomplete_type_error (tree ARG_UNUSED (value), tree type)
{
! if (TREE_CODE (type) == ERROR_MARK)
! return;
!
! abort ();
}
/* Provide a default routine for alias sets that always returns -1. This
--- 212,218 ----
void
lhd_incomplete_type_error (tree ARG_UNUSED (value), tree type)
{
! gcc_assert (TREE_CODE (type) == ERROR_MARK);
}
/* Provide a default routine for alias sets that always returns -1. This
*************** lhd_expand_expr (tree ARG_UNUSED (t), rt
*** 247,253 ****
int ARG_UNUSED (em),
rtx * ARG_UNUSED (a))
{
! abort ();
}
/* The default language-specific function for expanding a decl. After
--- 241,247 ----
int ARG_UNUSED (em),
rtx * ARG_UNUSED (a))
{
! gcc_unreachable ();
}
/* The default language-specific function for expanding a decl. After
*************** lhd_types_compatible_p (tree x, tree y)
*** 287,293 ****
information associated to common tree codes. If a tree node is
completely handled within this function, it should set *SUBTREES to
0, so that generic handling isn't attempted. For language-specific
! tree codes, generic handling would abort(), so make sure it is set
properly. Both SUBTREES and *SUBTREES is guaranteed to be nonzero
when the function is called. */
--- 281,287 ----
information associated to common tree codes. If a tree node is
completely handled within this function, it should set *SUBTREES to
0, so that generic handling isn't attempted. For language-specific
! tree codes, generic handling would assert out, so make sure it is set
properly. Both SUBTREES and *SUBTREES is guaranteed to be nonzero
when the function is called. */
*************** lhd_gimplify_expr (tree *expr_p ATTRIBUT
*** 442,449 ****
size_t
lhd_tree_size (enum tree_code c ATTRIBUTE_UNUSED)
{
! abort ();
! return 0;
}
/* Return true if decl, which is a function decl, may be called by a
--- 436,442 ----
size_t
lhd_tree_size (enum tree_code c ATTRIBUTE_UNUSED)
{
! gcc_unreachable ();
}
/* Return true if decl, which is a function decl, may be called by a
Index: lcm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/lcm.c,v
retrieving revision 1.63
diff -c -3 -p -r1.63 lcm.c
*** lcm.c 4 Sep 2004 13:18:16 -0000 1.63
--- lcm.c 9 Sep 2004 14:23:22 -0000
*************** optimize_mode_switching (FILE *file)
*** 1029,1036 ****
{
regset live_at_end = eg->src->global_live_at_end;
! if (pre_exit)
! abort ();
pre_exit = split_edge (eg);
COPY_REG_SET (pre_exit->global_live_at_start, live_at_end);
COPY_REG_SET (pre_exit->global_live_at_end, live_at_end);
--- 1029,1035 ----
{
regset live_at_end = eg->src->global_live_at_end;
! gcc_assert (!pre_exit);
pre_exit = split_edge (eg);
COPY_REG_SET (pre_exit->global_live_at_start, live_at_end);
COPY_REG_SET (pre_exit->global_live_at_end, live_at_end);
*************** optimize_mode_switching (FILE *file)
*** 1208,1228 ****
emited = true;
if (JUMP_P (BB_END (src_bb)))
emit_insn_before (mode_set, BB_END (src_bb));
- /* It doesn't make sense to switch to normal mode
- after a CALL_INSN, so we're going to abort if we
- find one. The cases in which a CALL_INSN may
- have an abnormal edge are sibcalls and EH edges.
- In the case of sibcalls, the dest basic-block is
- the EXIT_BLOCK, that runs in normal mode; it is
- assumed that a sibcall insn requires normal mode
- itself, so no mode switch would be required after
- the call (it wouldn't make sense, anyway). In
- the case of EH edges, EH entry points also start
- in normal mode, so a similar reasoning applies. */
- else if (NONJUMP_INSN_P (BB_END (src_bb)))
- emit_insn_after (mode_set, BB_END (src_bb));
else
! abort ();
bb_info[j][src_bb->index].computing = mode;
RESET_BIT (transp[src_bb->index], j);
}
--- 1207,1228 ----
emited = true;
if (JUMP_P (BB_END (src_bb)))
emit_insn_before (mode_set, BB_END (src_bb));
else
! {
! /* It doesn't make sense to switch to normal mode
! after a CALL_INSN, so we're going to abort if we
! find one. The cases in which a CALL_INSN may
! have an abnormal edge are sibcalls and EH edges.
! In the case of sibcalls, the dest basic-block is
! the EXIT_BLOCK, that runs in normal mode; it is
! assumed that a sibcall insn requires normal mode
! itself, so no mode switch would be required after
! the call (it wouldn't make sense, anyway). In
! the case of EH edges, EH entry points also start
! in normal mode, so a similar reasoning applies. */
! gcc_assert (NONJUMP_INSN_P (BB_END (src_bb)));
! emit_insn_after (mode_set, BB_END (src_bb));
! }
bb_info[j][src_bb->index].computing = mode;
RESET_BIT (transp[src_bb->index], j);
}
Index: local-alloc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/local-alloc.c,v
retrieving revision 1.136
diff -c -3 -p -r1.136 local-alloc.c
*** local-alloc.c 18 Aug 2004 08:24:00 -0000 1.136
--- local-alloc.c 9 Sep 2004 14:23:28 -0000
*************** update_equiv_regs (void)
*** 1028,1036 ****
once and used once. (If it were only set, but not used,
flow would have deleted the setting insns.) Hence
there can only be one insn in reg_equiv[REGNO].init_insns. */
! if (reg_equiv[regno].init_insns == NULL_RTX
! || XEXP (reg_equiv[regno].init_insns, 1) != NULL_RTX)
! abort ();
equiv_insn = XEXP (reg_equiv[regno].init_insns, 0);
/* We may not move instructions that can throw, since
--- 1028,1036 ----
once and used once. (If it were only set, but not used,
flow would have deleted the setting insns.) Hence
there can only be one insn in reg_equiv[REGNO].init_insns. */
! gcc_assert (reg_equiv[regno].init_insns != NULL_RTX);
! gcc_assert (XEXP (reg_equiv[regno].init_insns, 1)
! == NULL_RTX);
equiv_insn = XEXP (reg_equiv[regno].init_insns, 0);
/* We may not move instructions that can throw, since
*************** block_alloc (int b)
*** 1188,1195 ****
while (1)
{
if (!NOTE_P (insn))
! if (++insn_count > max_uid)
! abort ();
if (insn == BB_HEAD (BASIC_BLOCK (b)))
break;
insn = PREV_INSN (insn);
--- 1188,1197 ----
while (1)
{
if (!NOTE_P (insn))
! {
! ++insn_count;
! gcc_assert (insn_count <= max_uid);
! }
if (insn == BB_HEAD (BASIC_BLOCK (b)))
break;
insn = PREV_INSN (insn);
*************** find_free_reg (enum reg_class class, enu
*** 2110,2117 ****
#endif
/* Validate our parameters. */
! if (born_index < 0 || born_index > dead_index)
! abort ();
/* Don't let a pseudo live in a reg across a function call
if we might get a nonlocal goto. */
--- 2112,2119 ----
#endif
/* Validate our parameters. */
! gcc_assert (born_index >= 0);
! gcc_assert (born_index < dead_index);
/* Don't let a pseudo live in a reg across a function call
if we might get a nonlocal goto. */
Index: loop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop.c,v
retrieving revision 1.508
diff -c -3 -p -r1.508 loop.c
*** loop.c 6 Sep 2004 18:38:27 -0000 1.508
--- loop.c 9 Sep 2004 14:23:50 -0000
*************** Software Foundation, 59 Temple Place - S
*** 77,83 ****
#ifndef HAVE_prefetch
#define HAVE_prefetch 0
#define CODE_FOR_prefetch 0
! #define gen_prefetch(a,b,c) (abort(), NULL_RTX)
#endif
/* Give up the prefetch optimizations once we exceed a given threshold.
--- 77,83 ----
#ifndef HAVE_prefetch
#define HAVE_prefetch 0
#define CODE_FOR_prefetch 0
! #define gen_prefetch(a,b,c) (gcc_unreachable(), NULL_RTX)
#endif
/* Give up the prefetch optimizations once we exceed a given threshold.
*************** loop_optimize (rtx f, FILE *dumpfile, in
*** 501,508 ****
/* See if we went too far. Note that get_max_uid already returns
one more that the maximum uid of all insn. */
! if (get_max_uid () > max_uid_for_loop)
! abort ();
/* Now reset it to the actual size we need. See above. */
max_uid_for_loop = get_max_uid ();
--- 501,508 ----
/* See if we went too far. Note that get_max_uid already returns
one more that the maximum uid of all insn. */
! gcc_assert (get_max_uid () <= max_uid_for_loop);
!
/* Now reset it to the actual size we need. See above. */
max_uid_for_loop = get_max_uid ();
*************** rtx_equal_for_loop_p (rtx x, rtx y, stru
*** 1746,1752 ****
contain anything but integers and other rtx's,
except for within LABEL_REFs and SYMBOL_REFs. */
default:
! abort ();
}
}
return 1;
--- 1746,1752 ----
contain anything but integers and other rtx's,
except for within LABEL_REFs and SYMBOL_REFs. */
default:
! gcc_unreachable ();
}
}
return 1;
*************** move_movables (struct loop *loop, struct
*** 1940,1960 ****
for (count = m->consec; count >= 0; count--)
{
! /* If this is the first insn of a library call sequence,
! something is very wrong. */
! if (!NOTE_P (p)
! && (temp = find_reg_note (p, REG_LIBCALL, NULL_RTX)))
! abort ();
!
! /* If this is the last insn of a libcall sequence, then
! delete every insn in the sequence except the last.
! The last insn is handled in the normal manner. */
! if (!NOTE_P (p)
! && (temp = find_reg_note (p, REG_RETVAL, NULL_RTX)))
{
! temp = XEXP (temp, 0);
! while (temp != p)
! temp = delete_insn (temp);
}
temp = p;
--- 1940,1963 ----
for (count = m->consec; count >= 0; count--)
{
! if (!NOTE_P (p))
{
! /* If this is the first insn of a library call
! sequence, something is very wrong. */
! gcc_assert (!find_reg_note (p, REG_LIBCALL,
! NULL_RTX));
!
! /* If this is the last insn of a libcall sequence,
! then delete every insn in the sequence except
! the last. The last insn is handled in the
! normal manner. */
! temp = find_reg_note (p, REG_RETVAL, NULL_RTX);
! if (temp)
! {
! temp = XEXP (temp, 0);
! while (temp != p)
! temp = delete_insn (temp);
! }
}
temp = p;
*************** move_movables (struct loop *loop, struct
*** 2118,2125 ****
<< GET_MODE_BITSIZE (m->savemode)))
- 1),
reg, 1, OPTAB_LIB_WIDEN);
! if (tem == 0)
! abort ();
if (tem != reg)
emit_move_insn (reg, tem);
sequence = get_insns ();
--- 2121,2127 ----
<< GET_MODE_BITSIZE (m->savemode)))
- 1),
reg, 1, OPTAB_LIB_WIDEN);
! gcc_assert (tem != 0);
if (tem != reg)
emit_move_insn (reg, tem);
sequence = get_insns ();
*************** replace_call_address (rtx x, rtx reg, rt
*** 2407,2414 ****
case MEM:
/* If this MEM uses a reg other than the one we expected,
something is wrong. */
! if (XEXP (x, 0) != reg)
! abort ();
XEXP (x, 0) = addr;
return;
--- 2409,2415 ----
case MEM:
/* If this MEM uses a reg other than the one we expected,
something is wrong. */
! gcc_assert (XEXP (x, 0) == reg);
XEXP (x, 0) = addr;
return;
*************** find_and_verify_loops (rtx f, struct loo
*** 2723,2730 ****
break;
case NOTE_INSN_LOOP_END:
! if (! current_loop)
! abort ();
current_loop->end = insn;
current_loop = current_loop->outer;
--- 2724,2730 ----
break;
case NOTE_INSN_LOOP_END:
! gcc_assert (current_loop);
current_loop->end = insn;
current_loop = current_loop->outer;
*************** find_and_verify_loops (rtx f, struct loo
*** 2912,2917 ****
--- 2912,2918 ----
if (invert_jump (p, new_label, 1))
{
rtx q, r;
+ bool fail;
/* If no suitable BARRIER was found, create a suitable
one before TARGET. Since TARGET is a fall through
*************** find_and_verify_loops (rtx f, struct loo
*** 2936,2943 ****
/* Include the BARRIER after INSN and copy the
block after LOC. */
! if (squeeze_notes (&new_label, &last_insn_to_move))
! abort ();
reorder_insns (new_label, last_insn_to_move, loc);
/* All those insns are now in TARGET_LOOP. */
--- 2937,2944 ----
/* Include the BARRIER after INSN and copy the
block after LOC. */
! fail = squeeze_notes (&new_label, &last_insn_to_move);
! gcc_assert (!fail);
reorder_insns (new_label, last_insn_to_move, loc);
/* All those insns are now in TARGET_LOOP. */
*************** find_and_verify_loops (rtx f, struct loo
*** 2972,2979 ****
/* If we didn't find it, then something is
wrong. */
! if (! r)
! abort ();
}
/* P is now a jump outside the loop, so it must be put
--- 2973,2979 ----
/* If we didn't find it, then something is
wrong. */
! gcc_assert (r);
}
/* P is now a jump outside the loop, so it must be put
*************** rtx_equal_for_prefetch_p (rtx x, rtx y)
*** 3683,3689 ****
contain anything but integers and other rtx's,
except for within LABEL_REFs and SYMBOL_REFs. */
default:
! abort ();
}
}
return 1;
--- 3683,3689 ----
contain anything but integers and other rtx's,
except for within LABEL_REFs and SYMBOL_REFs. */
default:
! gcc_unreachable ();
}
}
return 1;
*************** record_giv (const struct loop *loop, str
*** 5721,5739 ****
/* Add the giv to the class of givs computed from one biv. */
bl = REG_IV_CLASS (ivs, REGNO (src_reg));
! if (bl)
! {
! v->next_iv = bl->giv;
! bl->giv = v;
! /* Don't count DEST_ADDR. This is supposed to count the number of
! insns that calculate givs. */
! if (type == DEST_REG)
! bl->giv_count++;
! bl->total_benefit += benefit;
! }
! else
! /* Fatal error, biv missing for this giv? */
! abort ();
if (type == DEST_ADDR)
{
--- 5721,5734 ----
/* Add the giv to the class of givs computed from one biv. */
bl = REG_IV_CLASS (ivs, REGNO (src_reg));
! gcc_assert (bl); /* Fatal error, biv missing for this giv? */
! v->next_iv = bl->giv;
! bl->giv = v;
! /* Don't count DEST_ADDR. This is supposed to count the number of
! insns that calculate givs. */
! if (type == DEST_REG)
! bl->giv_count++;
! bl->total_benefit += benefit;
if (type == DEST_ADDR)
{
*************** general_induction_var (const struct loop
*** 6388,6394 ****
break;
default:
! abort ();
}
/* Remove any enclosing USE from ADD_VAL and MULT_VAL (there will be
--- 6383,6389 ----
break;
default:
! gcc_unreachable ();
}
/* Remove any enclosing USE from ADD_VAL and MULT_VAL (there will be
*************** simplify_giv_expr (const struct loop *lo
*** 6507,6513 ****
ext_val, benefit);
default:
! abort ();
}
/* Each argument must be either REG, PLUS, or MULT. Convert REG to
--- 6502,6508 ----
ext_val, benefit);
default:
! gcc_unreachable ();
}
/* Each argument must be either REG, PLUS, or MULT. Convert REG to
*************** simplify_giv_expr (const struct loop *lo
*** 6648,6654 ****
ext_val, benefit);
default:
! abort ();
}
case ASHIFT:
--- 6643,6649 ----
ext_val, benefit);
default:
! gcc_unreachable ();
}
case ASHIFT:
*************** check_ext_dependent_givs (const struct l
*** 7400,7406 ****
break;
default:
! abort ();
}
if (ok)
--- 7395,7401 ----
break;
default:
! gcc_unreachable ();
}
if (ok)
*************** try_copy_prop (const struct loop *loop,
*** 10040,10047 ****
&& REG_P (SET_DEST (set))
&& REGNO (SET_DEST (set)) == regno)
{
! if (init_insn)
! abort ();
init_insn = insn;
if (REGNO_FIRST_UID (regno) == INSN_UID (insn))
--- 10035,10041 ----
&& REG_P (SET_DEST (set))
&& REGNO (SET_DEST (set)) == regno)
{
! gcc_assert (!init_insn);
init_insn = insn;
if (REGNO_FIRST_UID (regno) == INSN_UID (insn))
*************** try_copy_prop (const struct loop *loop,
*** 10074,10081 ****
}
}
}
! if (! init_insn)
! abort ();
if (apply_change_group ())
{
if (loop_dump_stream)
--- 10068,10074 ----
}
}
}
! gcc_assert (init_insn);
if (apply_change_group ())
{
if (loop_dump_stream)
*************** loop_giv_dump (const struct induction *v
*** 10576,10582 ****
fprintf (file, " ext tr");
break;
default:
! abort ();
}
}
--- 10569,10575 ----
fprintf (file, " ext tr");
break;
default:
! gcc_unreachable ();
}
}
Index: loop-doloop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop-doloop.c,v
retrieving revision 2.5
diff -c -3 -p -r2.5 loop-doloop.c
*** loop-doloop.c 9 Jul 2004 03:29:33 -0000 2.5
--- loop-doloop.c 9 Sep 2004 14:23:51 -0000
*************** doloop_modify (struct loop *loop, struct
*** 303,318 ****
increment_count = true;
noloop = const1_rtx;
}
- else if (XEXP (condition, 1) == const0_rtx)
- noloop = const0_rtx;
else
! abort ();
break;
case GE:
/* Currently only GE tests against zero are supported. */
! if (XEXP (condition, 1) != const0_rtx)
! abort ();
noloop = constm1_rtx;
--- 303,318 ----
increment_count = true;
noloop = const1_rtx;
}
else
! {
! gcc_assert (XEXP (condition, 1) == const0_rtx);
! noloop = const0_rtx;
! }
break;
case GE:
/* Currently only GE tests against zero are supported. */
! gcc_assert (XEXP (condition, 1) == const0_rtx);
noloop = constm1_rtx;
*************** doloop_modify (struct loop *loop, struct
*** 327,335 ****
nonneg = 1;
break;
- /* Abort if an invalid doloop pattern has been generated. */
default:
! abort ();
}
if (increment_count)
--- 327,335 ----
nonneg = 1;
break;
default:
! /* Abort if an invalid doloop pattern has been generated. */
! gcc_unreachable ();
}
if (increment_count)
Index: loop.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop.h,v
retrieving revision 1.71
diff -c -3 -p -r1.71 loop.h
*** loop.h 24 Mar 2004 23:45:41 -0000 1.71
--- loop.h 9 Sep 2004 14:23:52 -0000
*************** Software Foundation, 59 Temple Place - S
*** 45,52 ****
of an insn added during loop, since these don't have LUIDs. */
#define INSN_LUID(INSN) \
! (INSN_UID (INSN) < max_uid_for_loop ? uid_luid[INSN_UID (INSN)] \
! : (abort (), -1))
#define REGNO_FIRST_LUID(REGNO) \
(REGNO_FIRST_UID (REGNO) < max_uid_for_loop \
--- 45,51 ----
of an insn added during loop, since these don't have LUIDs. */
#define INSN_LUID(INSN) \
! (gcc_assert (INSN_UID (INSN) < max_uid_for_loop), uid_luid[INSN_UID (INSN)])
#define REGNO_FIRST_LUID(REGNO) \
(REGNO_FIRST_UID (REGNO) < max_uid_for_loop \
Index: loop-invariant.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop-invariant.c,v
retrieving revision 2.3
diff -c -3 -p -r2.3 loop-invariant.c
*** loop-invariant.c 18 Aug 2004 08:24:01 -0000 2.3
--- loop-invariant.c 9 Sep 2004 14:23:54 -0000
*************** record_use (struct def *def, rtx *use, r
*** 353,360 ****
if (GET_CODE (*use) == SUBREG)
use = &SUBREG_REG (*use);
! if (!REG_P (*use))
! abort ();
u->pos = use;
u->insn = insn;
--- 353,359 ----
if (GET_CODE (*use) == SUBREG)
use = &SUBREG_REG (*use);
! gcc_assert (REG_P (*use));
u->pos = use;
u->insn = insn;
Index: loop-iv.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop-iv.c,v
retrieving revision 2.16
diff -c -3 -p -r2.16 loop-iv.c
*** loop-iv.c 18 Aug 2004 17:04:59 -0000 2.16
--- loop-iv.c 9 Sep 2004 14:23:58 -0000
*************** get_biv_step_1 (rtx insn, rtx reg,
*** 793,808 ****
case SIGN_EXTEND:
case ZERO_EXTEND:
! if (GET_MODE (op0) != *inner_mode
! || *extend != UNKNOWN
! || *outer_step != const0_rtx)
! abort ();
*extend = code;
break;
default:
! abort ();
}
return true;
--- 793,807 ----
case SIGN_EXTEND:
case ZERO_EXTEND:
! gcc_assert (GET_MODE (op0) == *inner_mode);
! gcc_assert (*extend == UNKNOWN);
! gcc_assert (*outer_step == const0_rtx);
*extend = code;
break;
default:
! gcc_unreachable ();
}
return true;
*************** get_biv_step (rtx reg, rtx *inner_step,
*** 826,842 ****
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 ();
return true;
}
--- 825,833 ----
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);
return true;
}
*************** iv_analyze (rtx insn, rtx def, struct rt
*** 1085,1092 ****
mby = XEXP (rhs, 1);
if (!CONSTANT_P (mby))
{
! if (!CONSTANT_P (op0))
! abort ();
tmp = op0;
op0 = mby;
mby = tmp;
--- 1076,1082 ----
mby = XEXP (rhs, 1);
if (!CONSTANT_P (mby))
{
! gcc_assert (CONSTANT_P (op0));
tmp = op0;
op0 = mby;
mby = tmp;
*************** iv_analyze (rtx insn, rtx def, struct rt
*** 1094,1107 ****
break;
case ASHIFT:
! if (CONSTANT_P (XEXP (rhs, 0)))
! abort ();
op0 = XEXP (rhs, 0);
mby = XEXP (rhs, 1);
break;
default:
! abort ();
}
amode = GET_MODE (rhs);
--- 1084,1096 ----
break;
case ASHIFT:
! gcc_assert (!CONSTANT_P (XEXP (rhs, 0)));
op0 = XEXP (rhs, 0);
mby = XEXP (rhs, 1);
break;
default:
! gcc_unreachable ();
}
amode = GET_MODE (rhs);
*************** get_iv_value (struct rtx_iv *iv, rtx ite
*** 1192,1199 ****
/* We would need to generate some if_then_else patterns, and so far
it is not needed anywhere. */
! if (iv->first_special)
! abort ();
if (iv->step != const0_rtx && iteration != const0_rtx)
val = simplify_gen_binary (PLUS, iv->extend_mode, iv->base,
--- 1181,1187 ----
/* 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->step != const0_rtx && iteration != const0_rtx)
val = simplify_gen_binary (PLUS, iv->extend_mode, iv->base,
*************** canon_condition (rtx cond)
*** 1529,1536 ****
mode = GET_MODE (op0);
if (mode == VOIDmode)
mode = GET_MODE (op1);
! if (mode == VOIDmode)
! abort ();
if (GET_CODE (op1) == CONST_INT
&& GET_MODE_CLASS (mode) != MODE_CC
--- 1517,1523 ----
mode = GET_MODE (op0);
if (mode == VOIDmode)
mode = GET_MODE (op1);
! gcc_assert (mode != VOIDmode);
if (GET_CODE (op1) == CONST_INT
&& GET_MODE_CLASS (mode) != MODE_CC
*************** simplify_using_condition (rtx cond, rtx
*** 1659,1678 ****
static void
eliminate_implied_condition (enum rtx_code op, rtx a, rtx *b)
{
! if (op == AND)
{
/* If A implies *B, we may replace *B by true. */
if (implies_p (a, *b))
*b = const_true_rtx;
! }
! else if (op == IOR)
! {
/* If *B implies A, we may replace *B by false. */
if (implies_p (*b, a))
*b = const0_rtx;
}
- else
- abort ();
}
/* Eliminates the conditions in TAIL that are implied by HEAD. OP is the
--- 1646,1666 ----
static void
eliminate_implied_condition (enum rtx_code op, rtx a, rtx *b)
{
! switch (op)
{
+ case AND:
/* If A implies *B, we may replace *B by true. */
if (implies_p (a, *b))
*b = const_true_rtx;
! 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 ();
}
}
/* Eliminates the conditions in TAIL that are implied by HEAD. OP is the
*************** simplify_using_initial_values (struct lo
*** 1714,1731 ****
eliminate_implied_conditions (op, &head, tail);
! if (op == AND)
{
neutral = const_true_rtx;
aggr = const0_rtx;
! }
! else if (op == IOR)
! {
neutral = const0_rtx;
aggr = const_true_rtx;
}
- else
- abort ();
simplify_using_initial_values (loop, UNKNOWN, &head);
if (head == aggr)
--- 1702,1720 ----
eliminate_implied_conditions (op, &head, tail);
! switch (op)
{
+ case AND:
neutral = const_true_rtx;
aggr = const0_rtx;
! break;
! case IOR:
neutral = const0_rtx;
aggr = const_true_rtx;
+ break;
+ default:
+ gcc_unreachable ();
}
simplify_using_initial_values (loop, UNKNOWN, &head);
if (head == aggr)
*************** simplify_using_initial_values (struct lo
*** 1753,1760 ****
return;
}
! if (op != UNKNOWN)
! abort ();
e = loop_preheader_edge (loop);
if (e->src == ENTRY_BLOCK_PTR)
--- 1742,1748 ----
return;
}
! gcc_assert (op == UNKNOWN);
e = loop_preheader_edge (loop);
if (e->src == ENTRY_BLOCK_PTR)
*************** shorten_into_mode (struct rtx_iv *iv, en
*** 1856,1862 ****
break;
default:
! abort ();
}
iv->mode = mode;
--- 1844,1850 ----
break;
default:
! gcc_unreachable ();
}
iv->mode = mode;
*************** canonicalize_iv_subregs (struct rtx_iv *
*** 1914,1920 ****
break;
default:
! abort ();
}
/* Values of both variables should be computed in the same mode. These
--- 1902,1908 ----
break;
default:
! gcc_unreachable ();
}
/* Values of both variables should be computed in the same mode. These
*************** iv_number_of_iterations (struct loop *lo
*** 2013,2027 ****
desc->niter_max = 0;
cond = GET_CODE (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. */
! if (mode == VOIDmode)
! abort ();
/* We only handle integers or pointers. */
if (GET_MODE_CLASS (mode) != MODE_INT
--- 2001,2013 ----
desc->niter_max = 0;
cond = GET_CODE (condition);
! 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. */
! gcc_assert (mode != VOIDmode);
/* We only handle integers or pointers. */
if (GET_MODE_CLASS (mode) != MODE_INT
Index: loop-unroll.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop-unroll.c,v
retrieving revision 1.16
diff -c -3 -p -r1.16 loop-unroll.c
*** loop-unroll.c 24 Feb 2004 23:39:55 -0000 1.16
--- loop-unroll.c 9 Sep 2004 14:24:00 -0000
*************** unroll_and_peel_loops (struct loops *loo
*** 116,122 ****
{
case LPT_PEEL_COMPLETELY:
/* Already done. */
! abort ();
case LPT_PEEL_SIMPLE:
peel_loop_simple (loops, loop);
break;
--- 116,122 ----
{
case LPT_PEEL_COMPLETELY:
/* Already done. */
! gcc_unreachable ();
case LPT_PEEL_SIMPLE:
peel_loop_simple (loops, loop);
break;
*************** unroll_and_peel_loops (struct loops *loo
*** 133,139 ****
check = false;
break;
default:
! abort ();
}
if (check)
{
--- 133,139 ----
check = false;
break;
default:
! gcc_unreachable ();
}
if (check)
{
*************** peel_loop_completely (struct loops *loop
*** 433,438 ****
--- 433,440 ----
if (npeel)
{
+ int ok;
+
wont_exit = sbitmap_alloc (npeel + 1);
sbitmap_ones (wont_exit);
RESET_BIT (wont_exit, 0);
*************** peel_loop_completely (struct loops *loop
*** 442,452 ****
remove_edges = xcalloc (npeel, sizeof (edge));
n_remove_edges = 0;
! if (!duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
! loops, npeel,
! wont_exit, desc->out_edge, remove_edges, &n_remove_edges,
! DLTHE_FLAG_UPDATE_FREQ))
! abort ();
free (wont_exit);
--- 444,455 ----
remove_edges = xcalloc (npeel, sizeof (edge));
n_remove_edges = 0;
! ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
! loops, npeel,
! wont_exit, desc->out_edge,
! remove_edges, &n_remove_edges,
! DLTHE_FLAG_UPDATE_FREQ);
! gcc_assert (ok);
free (wont_exit);
*************** unroll_loop_constant_iterations (struct
*** 597,607 ****
unsigned max_unroll = loop->lpt_decision.times;
struct niter_desc *desc = get_simple_loop_desc (loop);
bool exit_at_end = loop_exit_at_end_p (loop);
niter = desc->niter;
! if (niter <= max_unroll + 1)
! abort (); /* Should not get here (such loop should be peeled instead). */
exit_mod = niter % (max_unroll + 1);
--- 600,611 ----
unsigned max_unroll = loop->lpt_decision.times;
struct niter_desc *desc = get_simple_loop_desc (loop);
bool exit_at_end = loop_exit_at_end_p (loop);
+ int ok;
niter = desc->niter;
! /* Should not assert out here (such loop should be peeled instead). */
! gcc_assert (niter > max_unroll + 1);
exit_mod = niter % (max_unroll + 1);
*************** unroll_loop_constant_iterations (struct
*** 627,638 ****
if (exit_mod)
{
! if (!duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
loops, exit_mod,
wont_exit, desc->out_edge,
remove_edges, &n_remove_edges,
! DLTHE_FLAG_UPDATE_FREQ))
! abort ();
desc->noloop_assumptions = NULL_RTX;
desc->niter -= exit_mod;
--- 631,644 ----
if (exit_mod)
{
! int ok;
!
! ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
loops, exit_mod,
wont_exit, desc->out_edge,
remove_edges, &n_remove_edges,
! DLTHE_FLAG_UPDATE_FREQ);
! gcc_assert (ok);
desc->noloop_assumptions = NULL_RTX;
desc->niter -= exit_mod;
*************** unroll_loop_constant_iterations (struct
*** 655,669 ****
if (exit_mod != max_unroll
|| desc->noloop_assumptions)
{
RESET_BIT (wont_exit, 0);
if (desc->noloop_assumptions)
RESET_BIT (wont_exit, 1);
! if (!duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
! loops, exit_mod + 1,
! wont_exit, desc->out_edge, remove_edges, &n_remove_edges,
! DLTHE_FLAG_UPDATE_FREQ))
! abort ();
desc->niter -= exit_mod + 1;
desc->niter_max -= exit_mod + 1;
--- 661,678 ----
if (exit_mod != max_unroll
|| desc->noloop_assumptions)
{
+ int ok;
+
RESET_BIT (wont_exit, 0);
if (desc->noloop_assumptions)
RESET_BIT (wont_exit, 1);
! ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
! loops, exit_mod + 1,
! wont_exit, desc->out_edge,
! remove_edges, &n_remove_edges,
! DLTHE_FLAG_UPDATE_FREQ);
! gcc_assert (ok);
desc->niter -= exit_mod + 1;
desc->niter_max -= exit_mod + 1;
*************** unroll_loop_constant_iterations (struct
*** 677,687 ****
}
/* Now unroll the loop. */
! if (!duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
! loops, max_unroll,
! wont_exit, desc->out_edge, remove_edges, &n_remove_edges,
! DLTHE_FLAG_UPDATE_FREQ))
! abort ();
free (wont_exit);
--- 686,697 ----
}
/* Now unroll the loop. */
! ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
! loops, max_unroll,
! wont_exit, desc->out_edge,
! remove_edges, &n_remove_edges,
! DLTHE_FLAG_UPDATE_FREQ);
! gcc_assert (ok);
free (wont_exit);
*************** unroll_loop_runtime_iterations (struct l
*** 842,847 ****
--- 852,858 ----
unsigned max_unroll = loop->lpt_decision.times;
struct niter_desc *desc = get_simple_loop_desc (loop);
bool exit_at_end = loop_exit_at_end_p (loop);
+ int ok;
/* Remember blocks whose dominators will have to be updated. */
dom_bbs = xcalloc (n_basic_blocks, sizeof (basic_block));
*************** unroll_loop_runtime_iterations (struct l
*** 916,926 ****
&& !desc->noloop_assumptions)
SET_BIT (wont_exit, 1);
ezc_swtch = loop_preheader_edge (loop)->src;
! if (!duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
! loops, 1,
! wont_exit, desc->out_edge, remove_edges, &n_remove_edges,
! DLTHE_FLAG_UPDATE_FREQ))
! abort ();
/* Record the place where switch will be built for preconditioning. */
swtch = loop_split_edge_with (loop_preheader_edge (loop),
--- 927,938 ----
&& !desc->noloop_assumptions)
SET_BIT (wont_exit, 1);
ezc_swtch = loop_preheader_edge (loop)->src;
! ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
! loops, 1,
! wont_exit, desc->out_edge,
! remove_edges, &n_remove_edges,
! DLTHE_FLAG_UPDATE_FREQ);
! gcc_assert (ok);
/* Record the place where switch will be built for preconditioning. */
swtch = loop_split_edge_with (loop_preheader_edge (loop),
*************** unroll_loop_runtime_iterations (struct l
*** 932,942 ****
sbitmap_zero (wont_exit);
if (i != n_peel - 1 || !last_may_exit)
SET_BIT (wont_exit, 1);
! if (!duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
! loops, 1,
! wont_exit, desc->out_edge, remove_edges, &n_remove_edges,
! DLTHE_FLAG_UPDATE_FREQ))
! abort ();
/* Create item for switch. */
j = n_peel - i - (extra_zero_check ? 0 : 1);
--- 944,955 ----
sbitmap_zero (wont_exit);
if (i != n_peel - 1 || !last_may_exit)
SET_BIT (wont_exit, 1);
! ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
! loops, 1,
! wont_exit, desc->out_edge,
! remove_edges, &n_remove_edges,
! DLTHE_FLAG_UPDATE_FREQ);
! gcc_assert (ok);
/* Create item for switch. */
j = n_peel - i - (extra_zero_check ? 0 : 1);
*************** unroll_loop_runtime_iterations (struct l
*** 979,989 ****
sbitmap_ones (wont_exit);
RESET_BIT (wont_exit, may_exit_copy);
! if (!duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
! loops, max_unroll,
! wont_exit, desc->out_edge, remove_edges, &n_remove_edges,
! DLTHE_FLAG_UPDATE_FREQ))
! abort ();
free (wont_exit);
--- 992,1003 ----
sbitmap_ones (wont_exit);
RESET_BIT (wont_exit, may_exit_copy);
! ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
! loops, max_unroll,
! wont_exit, desc->out_edge,
! remove_edges, &n_remove_edges,
! DLTHE_FLAG_UPDATE_FREQ);
! gcc_assert (ok);
free (wont_exit);
*************** unroll_loop_runtime_iterations (struct l
*** 1013,1020 ****
preconditioning and the fact that the value must be valid at entry
of the loop. After passing through the above code, we see that
the correct new number of iterations is this: */
! if (desc->const_iter)
! abort ();
desc->niter_expr =
simplify_gen_binary (UDIV, desc->mode, old_niter, GEN_INT (max_unroll + 1));
desc->niter_max /= max_unroll + 1;
--- 1027,1033 ----
preconditioning and the fact that the value must be valid at entry
of the loop. After passing through the above code, we see that
the correct new number of iterations is this: */
! gcc_assert (!desc->const_iter);
desc->niter_expr =
simplify_gen_binary (UDIV, desc->mode, old_niter, GEN_INT (max_unroll + 1));
desc->niter_max /= max_unroll + 1;
*************** peel_loop_simple (struct loops *loops, s
*** 1138,1151 ****
sbitmap wont_exit;
unsigned npeel = loop->lpt_decision.times;
struct niter_desc *desc = get_simple_loop_desc (loop);
wont_exit = sbitmap_alloc (npeel + 1);
sbitmap_zero (wont_exit);
! if (!duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
! loops, npeel, wont_exit, NULL, NULL, NULL,
! DLTHE_FLAG_UPDATE_FREQ))
! abort ();
free (wont_exit);
--- 1151,1166 ----
sbitmap wont_exit;
unsigned npeel = loop->lpt_decision.times;
struct niter_desc *desc = get_simple_loop_desc (loop);
+ int ok;
wont_exit = sbitmap_alloc (npeel + 1);
sbitmap_zero (wont_exit);
! ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
! loops, npeel, wont_exit,
! NULL, NULL, NULL,
! DLTHE_FLAG_UPDATE_FREQ);
! gcc_assert (ok);
free (wont_exit);
*************** unroll_loop_stupid (struct loops *loops,
*** 1271,1284 ****
sbitmap wont_exit;
unsigned nunroll = loop->lpt_decision.times;
struct niter_desc *desc = get_simple_loop_desc (loop);
wont_exit = sbitmap_alloc (nunroll + 1);
sbitmap_zero (wont_exit);
! if (!duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
! loops, nunroll, wont_exit, NULL, NULL, NULL,
! DLTHE_FLAG_UPDATE_FREQ))
! abort ();
free (wont_exit);
--- 1286,1301 ----
sbitmap wont_exit;
unsigned nunroll = loop->lpt_decision.times;
struct niter_desc *desc = get_simple_loop_desc (loop);
+ int ok;
wont_exit = sbitmap_alloc (nunroll + 1);
sbitmap_zero (wont_exit);
! ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
! loops, nunroll, wont_exit,
! NULL, NULL, NULL,
! DLTHE_FLAG_UPDATE_FREQ);
! gcc_assert (ok);
free (wont_exit);
Index: loop-unswitch.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop-unswitch.c,v
retrieving revision 1.19
diff -c -3 -p -r1.19 loop-unswitch.c
*** loop-unswitch.c 27 Jul 2004 07:27:12 -0000 1.19
--- loop-unswitch.c 9 Sep 2004 14:24:01 -0000
*************** compare_and_jump_seq (rtx op0, rtx op1,
*** 103,115 ****
{
/* A hack -- there seems to be no easy generic way how to make a
conditional jump from a ccmode comparison. */
! if (!cinsn)
! abort ();
cond = XEXP (SET_SRC (pc_set (cinsn)), 0);
! if (GET_CODE (cond) != comp
! || !rtx_equal_p (op0, XEXP (cond, 0))
! || !rtx_equal_p (op1, XEXP (cond, 1)))
! abort ();
emit_jump_insn (copy_insn (PATTERN (cinsn)));
jump = get_last_insn ();
JUMP_LABEL (jump) = JUMP_LABEL (cinsn);
--- 103,113 ----
{
/* A hack -- there seems to be no easy generic way how to make a
conditional jump from a ccmode comparison. */
! gcc_assert (cinsn);
cond = XEXP (SET_SRC (pc_set (cinsn)), 0);
! gcc_assert (GET_CODE (cond) == comp);
! gcc_assert (rtx_equal_p (op0, XEXP (cond, 0)));
! gcc_assert (rtx_equal_p (op1, XEXP (cond, 1)));
emit_jump_insn (copy_insn (PATTERN (cinsn)));
jump = get_last_insn ();
JUMP_LABEL (jump) = JUMP_LABEL (cinsn);
*************** compare_and_jump_seq (rtx op0, rtx op1,
*** 118,125 ****
}
else
{
! if (cinsn)
! abort ();
op0 = force_operand (op0, NULL_RTX);
op1 = force_operand (op1, NULL_RTX);
--- 116,122 ----
}
else
{
! gcc_assert (!cinsn);
op0 = force_operand (op0, NULL_RTX);
op1 = force_operand (op1, NULL_RTX);
*************** unswitch_single_loop (struct loops *loop
*** 379,386 ****
/* Unswitch the loop on this condition. */
nloop = unswitch_loop (loops, loop, bbs[i], cond, cinsn);
! if (!nloop)
! abort ();
/* Invoke itself on modified loops. */
unswitch_single_loop (loops, nloop, rconds, num + 1);
--- 376,382 ----
/* Unswitch the loop on this condition. */
nloop = unswitch_loop (loops, loop, bbs[i], cond, cinsn);
! gcc_assert (nloop);
/* Invoke itself on modified loops. */
unswitch_single_loop (loops, nloop, rconds, num + 1);
*************** unswitch_loop (struct loops *loops, stru
*** 412,430 ****
rtx seq;
/* Some sanity checking. */
! if (!flow_bb_inside_loop_p (loop, unswitch_on))
! abort ();
! if (!unswitch_on->succ || !unswitch_on->succ->succ_next ||
! unswitch_on->succ->succ_next->succ_next)
! abort ();
! if (!just_once_each_iteration_p (loop, unswitch_on))
! abort ();
! if (loop->inner)
! abort ();
! if (!flow_bb_inside_loop_p (loop, unswitch_on->succ->dest))
! abort ();
! if (!flow_bb_inside_loop_p (loop, unswitch_on->succ->succ_next->dest))
! abort ();
entry = loop_preheader_edge (loop);
--- 408,424 ----
rtx seq;
/* Some sanity checking. */
! gcc_assert (flow_bb_inside_loop_p (loop, unswitch_on));
!
! gcc_assert (unswitch_on->succ);
! gcc_assert (unswitch_on->succ->succ_next);
! gcc_assert (!unswitch_on->succ->succ_next->succ_next);
!
! gcc_assert (just_once_each_iteration_p (loop, unswitch_on));
! gcc_assert (!loop->inner);
! gcc_assert (flow_bb_inside_loop_p (loop, unswitch_on->succ->dest));
! gcc_assert (flow_bb_inside_loop_p (loop,
! unswitch_on->succ->succ_next->dest));
entry = loop_preheader_edge (loop);
Index: modulo-sched.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/modulo-sched.c,v
retrieving revision 1.12
diff -c -3 -p -r1.12 modulo-sched.c
*** modulo-sched.c 5 Sep 2004 15:24:11 -0000 1.12
--- modulo-sched.c 9 Sep 2004 14:24:07 -0000
*************** normalize_sched_times (partial_schedule_
*** 546,553 ****
ddg_node_ptr u = &g->nodes[i];
int normalized_time = SCHED_TIME (u) - amount;
! if (normalized_time < 0)
! abort ();
SCHED_TIME (u) = normalized_time;
SCHED_ROW (u) = normalized_time % ii;
--- 546,552 ----
ddg_node_ptr u = &g->nodes[i];
int normalized_time = SCHED_TIME (u) - amount;
! gcc_assert (normalized_time >= 0);
SCHED_TIME (u) = normalized_time;
SCHED_ROW (u) = normalized_time % ii;
*************** generate_prolog_epilog (partial_schedule
*** 714,721 ****
label = XEXP (SET_SRC (cmp), 1);
cond = XEXP (SET_SRC (cmp), 0);
! if (! c_reg || GET_CODE (cond) != NE)
! abort ();
XEXP (label, 0) = precond_exit_label;
JUMP_LABEL (orig_loop_bct) = precond_exit_label_insn;
--- 713,720 ----
label = XEXP (SET_SRC (cmp), 1);
cond = XEXP (SET_SRC (cmp), 0);
! gcc_assert (c_reg);
! gcc_assert (GET_CODE (cond) == NE);
XEXP (label, 0) = precond_exit_label;
JUMP_LABEL (orig_loop_bct) = precond_exit_label_insn;
*************** sms_schedule (FILE *dump_file)
*** 1025,1032 ****
}
/* Make sure this is a doloop. */
! if ( !(count_reg = doloop_register_get (tail, &comp)))
! abort ();
/* This should be NULL_RTX if the count is unknown at compile time. */
count_init = const_iteration_count (count_reg, pre_header, &loop_count);
--- 1024,1031 ----
}
/* Make sure this is a doloop. */
! count_reg = doloop_register_get (tail, &comp);
! gcc_assert (count_reg);
/* This should be NULL_RTX if the count is unknown at compile time. */
count_init = const_iteration_count (count_reg, pre_header, &loop_count);
*************** check_nodes_order (int *node_order, int
*** 1457,1464 ****
{
int u = node_order[i];
! if (u >= num_nodes || u < 0 || TEST_BIT (tmp, u))
! abort ();
SET_BIT (tmp, u);
}
--- 1456,1464 ----
{
int u = node_order[i];
! gcc_assert (u < num_nodes);
! gcc_assert (u >= 0);
! gcc_assert (!TEST_BIT (tmp, u));
SET_BIT (tmp, u);
}
Index: optabs.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/optabs.c,v
retrieving revision 1.239
diff -c -3 -p -r1.239 optabs.c
*** optabs.c 5 Sep 2004 15:24:12 -0000 1.239
--- optabs.c 9 Sep 2004 14:24:16 -0000
*************** static rtx expand_parity (enum machine_m
*** 119,125 ****
#ifndef HAVE_conditional_trap
#define HAVE_conditional_trap 0
! #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
--- 119,125 ----
#ifndef HAVE_conditional_trap
#define HAVE_conditional_trap 0
! #define gen_conditional_trap(a,b) (gcc_unreachable (), NULL_RTX)
#endif
/* Add a REG_EQUAL note to the last insn in INSNS. TARGET is being set to
*************** add_equal_note (rtx insns, rtx target, e
*** 138,147 ****
rtx last_insn, insn, set;
rtx note;
! 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
--- 138,146 ----
rtx last_insn, insn, set;
rtx note;
! gcc_assert (insns);
! gcc_assert (INSN_P (insns));
! gcc_assert (NEXT_INSN (insns) != NULL_RTX);
if (GET_RTX_CLASS (code) != RTX_COMM_ARITH
&& GET_RTX_CLASS (code) != RTX_BIN_ARITH
*************** expand_simple_binop (enum machine_mode m
*** 672,679 ****
enum optab_methods methods)
{
optab binop = code_to_optab[(int) code];
! if (binop == 0)
! abort ();
return expand_binop (mode, binop, op0, op1, target, unsignedp, methods);
}
--- 671,677 ----
enum optab_methods methods)
{
optab binop = code_to_optab[(int) code];
! gcc_assert (binop != 0);
return expand_binop (mode, binop, op0, op1, target, unsignedp, methods);
}
*************** expand_twoval_unop (optab unoptab, rtx o
*** 1712,1720 ****
/* We could handle this, but we should always be called with a pseudo
for our targets and all insns should take them as outputs. */
! 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)
--- 1710,1717 ----
/* 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));
pat = GEN_FCN (icode) (targ0, targ1, xop0);
if (pat)
*************** expand_twoval_binop (optab binoptab, rtx
*** 1841,1849 ****
/* We could handle this, but we should always be called with a pseudo
for our targets and all insns should take them as outputs. */
! 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)
--- 1838,1845 ----
/* 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));
pat = GEN_FCN (icode) (targ0, xop0, xop1, targ1);
if (pat)
*************** expand_twoval_binop_libfunc (optab binop
*** 1906,1913 ****
rtx insns;
/* Exactly one of TARG0 or TARG1 should be non-NULL. */
! if (!((targ0 != NULL_RTX) ^ (targ1 != NULL_RTX)))
! abort ();
mode = GET_MODE (op0);
if (!binoptab->handlers[(int) mode].libfunc)
--- 1902,1908 ----
rtx insns;
/* Exactly one of TARG0 or TARG1 should be non-NULL. */
! gcc_assert ((targ0 != NULL_RTX) ^ (targ1 != NULL_RTX));
mode = GET_MODE (op0);
if (!binoptab->handlers[(int) mode].libfunc)
*************** expand_simple_unop (enum machine_mode mo
*** 1944,1951 ****
rtx target, int unsignedp)
{
optab unop = code_to_optab[(int) code];
! if (unop == 0)
! abort ();
return expand_unop (mode, unop, op0, target, unsignedp);
}
--- 1939,1945 ----
rtx target, int unsignedp)
{
optab unop = code_to_optab[(int) code];
! gcc_assert (unop != 0);
return expand_unop (mode, unop, op0, target, unsignedp);
}
*************** emit_no_conflict_block (rtx insns, rtx t
*** 2620,2627 ****
}
}
! if (set == 0)
! abort ();
if (! reg_overlap_mentioned_p (target, SET_DEST (set)))
{
--- 2614,2620 ----
}
}
! gcc_assert (set != 0);
if (! reg_overlap_mentioned_p (target, SET_DEST (set)))
{
*************** prepare_cmp_insn (rtx *px, rtx *py, enum
*** 2932,2938 ****
/* 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 call abort,
reminding the programmer to implement such folding. */
if (mode != BLKmode && flag_force_mem)
--- 2925,2931 ----
/* 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,
reminding the programmer to implement such folding. */
if (mode != BLKmode && flag_force_mem)
*************** prepare_cmp_insn (rtx *px, rtx *py, enum
*** 2961,2971 ****
y = force_reg (mode, y);
#ifdef HAVE_cc0
! /* Abort if we have a non-canonical comparison. The RTL documentation
states that canonical comparisons are required only for targets which
have cc0. */
! if (CONSTANT_P (x) && ! CONSTANT_P (y))
! abort ();
#endif
/* Don't let both operands fail to indicate the mode. */
--- 2954,2963 ----
y = force_reg (mode, y);
#ifdef HAVE_cc0
! /* Assert out 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));
#endif
/* Don't let both operands fail to indicate the mode. */
*************** prepare_cmp_insn (rtx *px, rtx *py, enum
*** 2984,2991 ****
rtx opalign
= GEN_INT (MIN (MEM_ALIGN (x), MEM_ALIGN (y)) / BITS_PER_UNIT);
! if (size == 0)
! abort ();
/* Try to use a memory block compare insn - either cmpstr
or cmpmem will do. */
--- 2976,2982 ----
rtx opalign
= GEN_INT (MIN (MEM_ALIGN (x), MEM_ALIGN (y)) / BITS_PER_UNIT);
! gcc_assert (size != 0);
/* Try to use a memory block compare insn - either cmpstr
or cmpmem will do. */
*************** prepare_cmp_insn (rtx *px, rtx *py, enum
*** 3082,3092 ****
return;
}
! 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
--- 3073,3080 ----
return;
}
! gcc_assert (class == MODE_FLOAT);
! prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp);
}
/* Before emitting an insn with code ICODE, make sure that X, which is going
*************** emit_cmp_and_jump_insn_1 (rtx x, rtx y,
*** 3126,3132 ****
enum machine_mode wider_mode = mode;
/* Try combined insns first. */
! do
{
enum insn_code icode;
PUT_MODE (test, wider_mode);
--- 3114,3120 ----
enum machine_mode wider_mode = mode;
/* Try combined insns first. */
! for (;;)
{
enum insn_code icode;
PUT_MODE (test, wider_mode);
*************** emit_cmp_and_jump_insn_1 (rtx x, rtx y,
*** 3169,3183 ****
return;
}
! if (class != MODE_INT && class != MODE_FLOAT
! && class != MODE_COMPLEX_FLOAT)
! break;
wider_mode = GET_MODE_WIDER_MODE (wider_mode);
}
- while (wider_mode != VOIDmode);
-
- abort ();
}
/* Generate code to compare X with Y so that the condition codes are
--- 3157,3168 ----
return;
}
! gcc_assert (class == MODE_INT || class == MODE_FLOAT
! || class == MODE_COMPLEX_FLOAT);
wider_mode = GET_MODE_WIDER_MODE (wider_mode);
+ gcc_assert (wider_mode != VOIDmode);
}
}
/* Generate code to compare X with Y so that the condition codes are
*************** emit_cmp_and_jump_insns (rtx x, rtx y, e
*** 3208,3215 ****
{
/* If we're not emitting a branch, this means some caller
is out of sync. */
! if (! label)
! abort ();
op0 = y, op1 = x;
comparison = swap_condition (comparison);
--- 3193,3199 ----
{
/* If we're not emitting a branch, this means some caller
is out of sync. */
! gcc_assert (label);
op0 = y, op1 = x;
comparison = swap_condition (comparison);
*************** prepare_float_lib_cmp (rtx *px, rtx *py,
*** 3280,3287 ****
}
}
! if (mode == VOIDmode)
! abort ();
if (mode != orig_mode)
{
--- 3264,3270 ----
}
}
! gcc_assert (mode != VOIDmode);
if (mode != orig_mode)
{
*************** prepare_float_lib_cmp (rtx *px, rtx *py,
*** 3339,3345 ****
break;
default:
! abort ();
}
equiv = simplify_gen_ternary (IF_THEN_ELSE, word_mode, word_mode,
equiv, true_rtx, false_rtx);
--- 3322,3328 ----
break;
default:
! gcc_unreachable ();
}
equiv = simplify_gen_ternary (IF_THEN_ELSE, word_mode, word_mode,
equiv, true_rtx, false_rtx);
*************** gen_add2_insn (rtx x, rtx y)
*** 3641,3653 ****
{
int icode = (int) add_optab->handlers[(int) GET_MODE (x)].insn_code;
! 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));
}
--- 3624,3635 ----
{
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));
return (GEN_FCN (icode) (x, x, y));
}
*************** have_add2_insn (rtx x, rtx y)
*** 3676,3683 ****
{
int icode;
! if (GET_MODE (x) == VOIDmode)
! abort ();
icode = (int) add_optab->handlers[(int) GET_MODE (x)].insn_code;
--- 3658,3664 ----
{
int icode;
! gcc_assert (GET_MODE (x) != VOIDmode);
icode = (int) add_optab->handlers[(int) GET_MODE (x)].insn_code;
*************** gen_sub2_insn (rtx x, rtx y)
*** 3702,3714 ****
{
int icode = (int) sub_optab->handlers[(int) GET_MODE (x)].insn_code;
! 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));
}
--- 3683,3694 ----
{
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));
return (GEN_FCN (icode) (x, x, y));
}
*************** have_sub2_insn (rtx x, rtx y)
*** 3737,3744 ****
{
int icode;
! if (GET_MODE (x) == VOIDmode)
! abort ();
icode = (int) sub_optab->handlers[(int) GET_MODE (x)].insn_code;
--- 3717,3723 ----
{
int icode;
! gcc_assert (GET_MODE (x) != VOIDmode);
icode = (int) sub_optab->handlers[(int) GET_MODE (x)].insn_code;
*************** expand_float (rtx to, rtx from, int unsi
*** 3864,3871 ****
enum machine_mode fmode, imode;
/* Crash now, because we won't be able to decide which mode to use. */
! 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
--- 3843,3849 ----
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);
/* Look for an insn to do the conversion. Do it in the specified
modes if possible; otherwise convert either input, output or both to
*************** expand_float (rtx to, rtx from, int unsi
*** 4026,4033 ****
from = force_not_mem (from);
libfunc = tab->handlers[GET_MODE (to)][GET_MODE (from)].libfunc;
! if (!libfunc)
! abort ();
start_sequence ();
--- 4004,4010 ----
from = force_not_mem (from);
libfunc = tab->handlers[GET_MODE (to)][GET_MODE (from)].libfunc;
! gcc_assert (libfunc);
start_sequence ();
*************** expand_fix (rtx to, rtx from, int unsign
*** 4210,4217 ****
convert_optab tab = unsignedp ? ufix_optab : sfix_optab;
libfunc = tab->handlers[GET_MODE (to)][GET_MODE (from)].libfunc;
! if (!libfunc)
! abort ();
if (flag_force_mem)
from = force_not_mem (from);
--- 4187,4193 ----
convert_optab tab = unsignedp ? ufix_optab : sfix_optab;
libfunc = tab->handlers[GET_MODE (to)][GET_MODE (from)].libfunc;
! gcc_assert (libfunc);
if (flag_force_mem)
from = force_not_mem (from);
*************** debug_optab_libfuncs (void)
*** 4824,4831 ****
h = &o->handlers[j];
if (h->libfunc)
{
! 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),
--- 4800,4806 ----
h = &o->handlers[j];
if (h->libfunc)
{
! gcc_assert (GET_CODE (h->libfunc) == SYMBOL_REF);
fprintf (stderr, "%s\t%s:\t%s\n",
GET_RTX_NAME (o->code),
GET_MODE_NAME (j),
*************** debug_optab_libfuncs (void)
*** 4845,4852 ****
h = &o->handlers[j][k];
if (h->libfunc)
{
! 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),
--- 4820,4826 ----
h = &o->handlers[j][k];
if (h->libfunc)
{
! gcc_assert (GET_CODE (h->libfunc) == SYMBOL_REF);
fprintf (stderr, "%s\t%s\t%s:\t%s\n",
GET_RTX_NAME (o->code),
GET_MODE_NAME (j),
Index: opts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/opts.c,v
retrieving revision 1.79
diff -c -3 -p -r1.79 opts.c
*** opts.c 3 Sep 2004 17:22:33 -0000 1.79
--- opts.c 9 Sep 2004 14:24:18 -0000
*************** common_handle_option (size_t scode, cons
*** 1019,1028 ****
default:
/* If the flag was handled in a standard way, assume the lack of
processing here is intentional. */
! if (cl_options[scode].flag_var)
! break;
!
! abort ();
}
return 1;
--- 1019,1026 ----
default:
/* If the flag was handled in a standard way, assume the lack of
processing here is intentional. */
! gcc_assert (cl_options[scode].flag_var);
! break;
}
return 1;
Index: params.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/params.c,v
retrieving revision 1.6
diff -c -3 -p -r1.6 params.c
*** params.c 19 Jul 2003 14:47:07 -0000 1.6
--- params.c 9 Sep 2004 14:24:18 -0000
*************** set_param_value (const char *name, int v
*** 61,68 ****
size_t i;
/* Make sure nobody tries to set a parameter to an invalid value. */
! if (value == INVALID_PARAM_VAL)
! abort ();
/* Scan the parameter table to find a matching entry. */
for (i = 0; i < num_compiler_params; ++i)
--- 61,67 ----
size_t i;
/* Make sure nobody tries to set a parameter to an invalid value. */
! gcc_assert (value != INVALID_PARAM_VAL);
/* Scan the parameter table to find a matching entry. */
for (i = 0; i < num_compiler_params; ++i)
Index: passes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/passes.c,v
retrieving revision 2.45
diff -c -3 -p -r2.45 passes.c
*** passes.c 6 Sep 2004 10:07:47 -0000 2.45
--- passes.c 9 Sep 2004 14:24:22 -0000
*************** open_dump_file (enum tree_dump_index ind
*** 121,128 ****
timevar_push (TV_DUMP);
! if (dump_file != NULL || dump_file_name != NULL)
! abort ();
dump_file_name = get_dump_file_name (index);
initializing_dump = !dump_initialized_p (index);
--- 121,128 ----
timevar_push (TV_DUMP);
! gcc_assert (!dump_file);
! gcc_assert (!dump_file_name);
dump_file_name = get_dump_file_name (index);
initializing_dump = !dump_initialized_p (index);
*************** rest_of_handle_final (void)
*** 289,299 ****
different from the DECL_NAME name used in the source file. */
x = DECL_RTL (current_function_decl);
! if (!MEM_P (x))
! abort ();
x = XEXP (x, 0);
! if (GET_CODE (x) != SYMBOL_REF)
! abort ();
fnname = XSTR (x, 0);
assemble_start_function (current_function_decl, fnname);
--- 289,297 ----
different from the DECL_NAME name used in the source file. */
x = DECL_RTL (current_function_decl);
! gcc_assert (MEM_P (x));
x = XEXP (x, 0);
! gcc_assert (GET_CODE (x) == SYMBOL_REF);
fnname = XSTR (x, 0);
assemble_start_function (current_function_decl, fnname);
Index: postreload.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/postreload.c,v
retrieving revision 2.20
diff -c -3 -p -r2.20 postreload.c
*** postreload.c 20 Aug 2004 09:59:34 -0000 2.20
--- postreload.c 9 Sep 2004 14:24:25 -0000
*************** reload_cse_simplify_set (rtx set, rtx in
*** 280,286 ****
if (this_val == trunc_int_for_mode (this_val, GET_MODE (src)))
break;
default:
! abort ();
}
this_rtx = GEN_INT (this_val);
}
--- 280,286 ----
if (this_val == trunc_int_for_mode (this_val, GET_MODE (src)))
break;
default:
! gcc_unreachable ();
}
this_rtx = GEN_INT (this_val);
}
*************** reload_combine_note_use (rtx *xp, rtx in
*** 1057,1064 ****
if (REG_P (SET_DEST (x)))
{
/* No spurious CLOBBERs of pseudo registers may remain. */
! if (REGNO (SET_DEST (x)) >= FIRST_PSEUDO_REGISTER)
! abort ();
return;
}
break;
--- 1057,1063 ----
if (REG_P (SET_DEST (x)))
{
/* No spurious CLOBBERs of pseudo registers may remain. */
! gcc_assert (REGNO (SET_DEST (x)) < FIRST_PSEUDO_REGISTER);
return;
}
break;
*************** reload_combine_note_use (rtx *xp, rtx in
*** 1078,1085 ****
int nregs;
/* No spurious USEs of pseudo registers may remain. */
! if (regno >= FIRST_PSEUDO_REGISTER)
! abort ();
nregs = hard_regno_nregs[regno][GET_MODE (x)];
--- 1077,1083 ----
int nregs;
/* No spurious USEs of pseudo registers may remain. */
! gcc_assert (regno < FIRST_PSEUDO_REGISTER);
nregs = hard_regno_nregs[regno][GET_MODE (x)];
Index: postreload-gcse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/postreload-gcse.c,v
retrieving revision 2.2
diff -c -3 -p -r2.2 postreload-gcse.c
*** postreload-gcse.c 5 Sep 2004 15:24:12 -0000 2.2
--- postreload-gcse.c 9 Sep 2004 14:24:28 -0000
*************** expr_equiv_p (const void *exp1p, const v
*** 305,313 ****
struct expr *exp1 = (struct expr *) exp1p;
struct expr *exp2 = (struct expr *) exp2p;
int equiv_p = exp_equiv_p (exp1->expr, exp2->expr, 0, true);
! if (equiv_p
! && exp1->hash != exp2->hash)
! abort ();
return equiv_p;
}
--- 305,311 ----
struct expr *exp1 = (struct expr *) exp1p;
struct expr *exp2 = (struct expr *) exp2p;
int equiv_p = exp_equiv_p (exp1->expr, exp2->expr, 0, true);
! gcc_assert (!equiv_p || exp1->hash == exp2->hash);
return equiv_p;
}
*************** oprs_unchanged_p (rtx x, rtx insn, bool
*** 485,495 ****
switch (code)
{
case REG:
- #ifdef ENABLE_CHECKING
/* We are called after register allocation. */
! if (REGNO (x) >= FIRST_PSEUDO_REGISTER)
! abort ();
! #endif
if (after_insn)
/* If the last CUID setting the insn is less than the CUID of
INSN, then reg X is not changed in or after INSN. */
--- 483,490 ----
switch (code)
{
case REG:
/* We are called after register allocation. */
! gcc_assert (REGNO (x) < FIRST_PSEUDO_REGISTER);
if (after_insn)
/* If the last CUID setting the insn is less than the CUID of
INSN, then reg X is not changed in or after INSN. */
*************** hash_scan_set (rtx insn)
*** 785,792 ****
#ifdef ENABLE_CHEKCING
/* We shouldn't have any EH_REGION notes post reload. */
! if (find_reg_note (insn, REG_EH_REGION, NULL_RTX))
! abort ();
#endif
if (REG_P (dest))
--- 780,786 ----
#ifdef ENABLE_CHEKCING
/* We shouldn't have any EH_REGION notes post reload. */
! gcc_assert (!find_reg_note (insn, REG_EH_REGION, NULL_RTX));
#endif
if (REG_P (dest))
*************** reg_set_between_after_reload_p (rtx reg,
*** 934,944 ****
rtx insn;
int regno;
- #ifdef ENABLE_CHECKING
/* We are called after register allocation. */
! if (!REG_P (reg) || REGNO (reg) >= FIRST_PSEUDO_REGISTER)
! abort ();
! #endif
if (from_insn == to_insn)
return NULL_RTX;
--- 928,936 ----
rtx insn;
int regno;
/* We are called after register allocation. */
! gcc_assert (REG_P (reg));
! gcc_assert (REGNO (reg) < FIRST_PSEUDO_REGISTER);
if (from_insn == to_insn)
return NULL_RTX;
*************** reg_used_between_after_reload_p (rtx reg
*** 973,983 ****
rtx insn;
int regno;
- #ifdef ENABLE_CHECKING
/* We are called after register allocation. */
! if (!REG_P (reg) || REGNO (reg) >= FIRST_PSEUDO_REGISTER)
! abort ();
! #endif
if (from_insn == to_insn)
return NULL_RTX;
--- 965,973 ----
rtx insn;
int regno;
/* We are called after register allocation. */
! gcc_assert (REG_P (reg));
! gcc_assert (REGNO (reg) < FIRST_PSEUDO_REGISTER);
if (from_insn == to_insn)
return NULL_RTX;
*************** get_avail_load_store_reg (rtx insn)
*** 1027,1033 ****
return SET_DEST(PATTERN(insn));
if (REG_P (SET_SRC (PATTERN (insn)))) /* A store. */
return SET_SRC (PATTERN (insn));
! abort ();
}
/* Return nonzero if the predecessors of BB are "well behaved". */
--- 1017,1023 ----
return SET_DEST(PATTERN(insn));
if (REG_P (SET_SRC (PATTERN (insn)))) /* A store. */
return SET_SRC (PATTERN (insn));
! gcc_unreachable ();
}
/* Return nonzero if the predecessors of BB are "well behaved". */
*************** eliminate_partially_redundant_load (basi
*** 1109,1116 ****
{
/* Check if the loaded register is not used. */
avail_insn = a_occr->insn;
! if (! (avail_reg = get_avail_load_store_reg (avail_insn)))
! abort ();
/* Make sure we can generate a move from register avail_reg to
dest. */
extract_insn (gen_move_insn (copy_rtx (dest),
--- 1099,1106 ----
{
/* Check if the loaded register is not used. */
avail_insn = a_occr->insn;
! avail_reg = get_avail_load_store_reg (avail_insn);
! gcc_assert (avail_reg);
/* Make sure we can generate a move from register avail_reg to
dest. */
extract_insn (gen_move_insn (copy_rtx (dest),
*************** eliminate_partially_redundant_load (basi
*** 1181,1188 ****
/* Set avail_reg to be the register having the value of the
memory. */
avail_reg = get_avail_load_store_reg (avail_insn);
! if (! avail_reg)
! abort ();
insert_insn_on_edge (gen_move_insn (copy_rtx (dest),
copy_rtx (avail_reg)),
--- 1171,1177 ----
/* Set avail_reg to be the register having the value of the
memory. */
avail_reg = get_avail_load_store_reg (avail_insn);
! gcc_assert (avail_reg);
insert_insn_on_edge (gen_move_insn (copy_rtx (dest),
copy_rtx (avail_reg)),
Index: predict.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/predict.c,v
retrieving revision 1.113
diff -c -3 -p -r1.113 predict.c
*** predict.c 9 Sep 2004 12:20:40 -0000 1.113
--- predict.c 9 Sep 2004 14:24:31 -0000
*************** tree_predicted_by_p (basic_block bb, enu
*** 179,186 ****
void
predict_insn (rtx insn, enum br_predictor predictor, int probability)
{
! if (!any_condjump_p (insn))
! abort ();
if (!flag_guess_branch_prob)
return;
--- 179,185 ----
void
predict_insn (rtx insn, enum br_predictor predictor, int probability)
{
! gcc_assert (any_condjump_p (insn));
if (!flag_guess_branch_prob)
return;
*************** expected_value_to_br_prob (void)
*** 1106,1113 ****
cond = simplify_rtx (cond);
/* Turn the condition into a scaled branch probability. */
! if (cond != const_true_rtx && cond != const0_rtx)
! abort ();
predict_insn_def (insn, PRED_BUILTIN_EXPECT,
cond == const_true_rtx ? TAKEN : NOT_TAKEN);
}
--- 1105,1111 ----
cond = simplify_rtx (cond);
/* Turn the condition into a scaled branch probability. */
! gcc_assert (cond == const_true_rtx || cond == const0_rtx);
predict_insn_def (insn, PRED_BUILTIN_EXPECT,
cond == const_true_rtx ? TAKEN : NOT_TAKEN);
}
*************** propagate_freq (struct loop *loop)
*** 1208,1215 ****
{
#ifdef ENABLE_CHECKING
for (e = bb->pred; e; e = e->pred_next)
! if (BLOCK_INFO (e->src)->tovisit && !(e->flags & EDGE_DFS_BACK))
! abort ();
#endif
for (e = bb->pred; e; e = e->pred_next)
--- 1206,1213 ----
{
#ifdef ENABLE_CHECKING
for (e = bb->pred; e; e = e->pred_next)
! gcc_assert (!BLOCK_INFO (e->src)->tovisit
! || (e->flags & EDGE_DFS_BACK));
#endif
for (e = bb->pred; e; e = e->pred_next)
*************** expensive_function_p (int threshold)
*** 1353,1360 ****
/* We can not compute accurately for large thresholds due to scaled
frequencies. */
! if (threshold > BB_FREQ_MAX)
! abort ();
/* Frequencies are out of range. This either means that function contains
internal loop executing more than BB_FREQ_MAX times or profile feedback
--- 1351,1357 ----
/* We can not compute accurately for large thresholds due to scaled
frequencies. */
! gcc_assert (threshold < BB_FREQ_MAX);
/* Frequencies are out of range. This either means that function contains
internal loop executing more than BB_FREQ_MAX times or profile feedback
Index: pretty-print.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/pretty-print.c,v
retrieving revision 2.15
diff -c -3 -p -r2.15 pretty-print.c
*** pretty-print.c 30 Jun 2004 18:17:56 -0000 2.15
--- pretty-print.c 9 Sep 2004 14:24:32 -0000
*************** pp_base_format_text (pretty_printer *pp,
*** 231,238 ****
break;
}
/* We don't support precision beyond that of "long long". */
! if (precision > 2)
! abort();
if (quoted)
pp_string (pp, open_quote);
--- 231,237 ----
break;
}
/* We don't support precision beyond that of "long long". */
! gcc_assert (precision <= 2);
if (quoted)
pp_string (pp, open_quote);
*************** pp_base_format_text (pretty_printer *pp,
*** 319,328 ****
int n;
const char *s;
/* We handle no precision specifier but '%.*s'. */
! if (*++text->format_spec != '*')
! abort ();
! else if (*++text->format_spec != 's')
! abort ();
n = va_arg (*text->args_ptr, int);
s = va_arg (*text->args_ptr, const char *);
pp_append_text (pp, s, s + n);
--- 318,327 ----
int n;
const char *s;
/* We handle no precision specifier but '%.*s'. */
! ++text->format_spec;
! gcc_assert (*text->format_spec == '*');
! ++text->format_spec;
! gcc_assert (*text->format_spec == 's');
n = va_arg (*text->args_ptr, int);
s = va_arg (*text->args_ptr, const char *);
pp_append_text (pp, s, s + n);
*************** pp_base_format_text (pretty_printer *pp,
*** 330,343 ****
break;
default:
! if (!pp_format_decoder (pp) || !(*pp_format_decoder (pp)) (pp, text))
! {
! /* Hmmm. The client failed to install a format translator
! but called us with an unrecognized format. Or, maybe, the
! translated string just contains an invalid format, or
! has formats in the wrong order. Sorry. */
! abort ();
! }
}
if (quoted)
pp_string (pp, close_quote);
--- 329,344 ----
break;
default:
! {
! bool ok;
!
! /* Make sure there's a format translator. */
! gcc_assert (pp_format_decoder (pp));
! ok = pp_format_decoder (pp) (pp, text);
! /* and make sure it recognized the format. */
! gcc_assert (ok);
! break;
! }
}
if (quoted)
pp_string (pp, close_quote);
Index: profile.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/profile.c,v
retrieving revision 1.137
diff -c -3 -p -r1.137 profile.c
*** profile.c 1 Sep 2004 20:58:52 -0000 1.137
--- profile.c 9 Sep 2004 17:50:25 -0000
*************** instrument_edges (struct edge_list *el)
*** 149,156 ****
if (!inf->ignore && !inf->on_tree)
{
! if (e->flags & EDGE_ABNORMAL)
! abort ();
if (dump_file)
fprintf (dump_file, "Edge %d to %d instrumented%s\n",
e->src->index, e->dest->index,
--- 149,155 ----
if (!inf->ignore && !inf->on_tree)
{
! gcc_assert (!(e->flags & EDGE_ABNORMAL));
if (dump_file)
fprintf (dump_file, "Edge %d to %d instrumented%s\n",
e->src->index, e->dest->index,
*************** instrument_values (histogram_values valu
*** 196,202 ****
break;
default:
! abort ();
}
if (!coverage_counter_alloc (t, hist->n_counters))
continue;
--- 195,201 ----
break;
default:
! gcc_unreachable ();
}
if (!coverage_counter_alloc (t, hist->n_counters))
continue;
*************** instrument_values (histogram_values valu
*** 220,226 ****
break;
default:
! abort ();
}
}
}
--- 219,225 ----
break;
default:
! gcc_unreachable ();
}
}
}
*************** compute_branch_probabilities (void)
*** 420,427 ****
/* Calculate count for remaining edge by conservation. */
total = bb->count - total;
! if (! e)
! abort ();
EDGE_INFO (e)->count_valid = 1;
e->count = total;
bi->succ_count--;
--- 419,425 ----
/* Calculate count for remaining edge by conservation. */
total = bb->count - total;
! gcc_assert (e);
EDGE_INFO (e)->count_valid = 1;
e->count = total;
bi->succ_count--;
*************** compute_branch_probabilities (void)
*** 447,454 ****
/* Calculate count for remaining edge by conservation. */
total = bb->count - total + e->count;
! if (! e)
! abort ();
EDGE_INFO (e)->count_valid = 1;
e->count = total;
bi->pred_count--;
--- 445,451 ----
/* Calculate count for remaining edge by conservation. */
total = bb->count - total + e->count;
! gcc_assert (e);
EDGE_INFO (e)->count_valid = 1;
e->count = total;
bi->pred_count--;
*************** compute_branch_probabilities (void)
*** 466,482 ****
if (dump_file)
fprintf (dump_file, "Graph solving took %d passes.\n\n", passes);
/* If the graph has been correctly solved, every block will have a
succ and pred count of zero. */
FOR_EACH_BB (bb)
{
! if (BB_INFO (bb)->succ_count || BB_INFO (bb)->pred_count)
! abort ();
}
!
/* For every edge, calculate its branch probability and add a reg_note
to the branch insn to indicate this. */
-
for (i = 0; i < 20; i++)
hist_br_prob[i] = 0;
num_never_executed = 0;
--- 463,480 ----
if (dump_file)
fprintf (dump_file, "Graph solving took %d passes.\n\n", passes);
+ #ifdef ENABLE_CHECKING
/* If the graph has been correctly solved, every block will have a
succ and pred count of zero. */
FOR_EACH_BB (bb)
{
! gcc_assert (!BB_INFO (bb)->succ_count);
! gcc_assert (!BB_INFO (bb)->pred_count);
}
! #endif
!
/* For every edge, calculate its branch probability and add a reg_note
to the branch insn to indicate this. */
for (i = 0; i < 20; i++)
hist_br_prob[i] = 0;
num_never_executed = 0;
*************** branch_prob (void)
*** 984,991 ****
{
unsigned n_instrumented = instrument_edges (el);
! if (n_instrumented != num_instrumented)
! abort ();
if (flag_profile_values)
instrument_values (values);
--- 982,988 ----
{
unsigned n_instrumented = instrument_edges (el);
! gcc_assert (n_instrumented == num_instrumented);
if (flag_profile_values)
instrument_values (values);
*************** union_groups (basic_block bb1, basic_blo
*** 1044,1051 ****
/* ??? I don't have a place for the rank field. OK. Lets go w/o it,
this code is unlikely going to be performance problem anyway. */
! if (bb1g == bb2g)
! abort ();
bb1g->aux = bb2g;
}
--- 1041,1047 ----
/* ??? I don't have a place for the rank field. OK. Lets go w/o it,
this code is unlikely going to be performance problem anyway. */
! gcc_assert (bb1g != bb2g);
bb1g->aux = bb2g;
}
*************** void
*** 1190,1197 ****
tree_register_profile_hooks (void)
{
profile_hooks = &tree_profile_hooks;
! if (!ir_type ())
! abort ();
}
/* Set up hooks to enable RTL-based profiling. */
--- 1186,1192 ----
tree_register_profile_hooks (void)
{
profile_hooks = &tree_profile_hooks;
! gcc_assert (ir_type ());
}
/* Set up hooks to enable RTL-based profiling. */
*************** void
*** 1200,1205 ****
rtl_register_profile_hooks (void)
{
profile_hooks = &rtl_profile_hooks;
! if (ir_type ())
! abort ();
}
--- 1195,1199 ----
rtl_register_profile_hooks (void)
{
profile_hooks = &rtl_profile_hooks;
! gcc_assert (!ir_type ());
}