summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-10-21 13:08:28 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-10-21 13:08:28 +0000
commit77a74ed7f000c8381733dcce7849621bd56b2f90 (patch)
tree3fd18866b18d41be7c750796537c0bd5af606091
parent31ff2426f662ec821ef48bee12eb3f08e4e16d9b (diff)
basic-block.h (single_succ_edge): Use gcc_checking_assert.
* basic-block.h (single_succ_edge): Use gcc_checking_assert. (single_pred_edge, ei_container, ei_next, ei_prev): Likewise. * cfghooks.c (fixup_reorder_chain): Likewise. * cfgrtl.c (cfg_layout_merge_blocks): Likewise. * cgraph.c (cgraph_add_thunk): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_create_virtual_clone): Likewise. * ddg.c (add_cross_iteration_register_deps): Likewise. * dwarf2out.c (modified_type_die): Likewise. * emit-rtl.c (set_mem_alias_set): Likewise. * ggc-zone.c (zone_allocate_marks): Likewise. * gimple-iterator.c (gsi_move_to_bb_end): Likewise. * gimple.c (iterative_hash_gimple_type): Likewise. * graphite-scop-detection.c (create_single_entry_edge): Likewise. (create_single_exit_edge): Likewise. * haifa-sched.c (choose_ready): Likewise. * lto-streamer-in.c (input_gimple_stmt): Likewise. * passes.c (execute_todo): Likewise. * sched-ebb.c (begin_schedule_ready): Likewise. * sel-sched.c (code_motion_process_successors): Likewise. * tree-call-cdce.c (gen_conditions_for_pow): Likewise. * tree-cfg-cleanup.c (tree_forwarder_block_p): Likewise. * tree-flow-inline.h (link_imm_use, move_use_after_head): Likewise. (phi_arg_index_from_use, phi_ssa_name_p): Likewise. * tree-into-ssa.c (insert_updated_phi_nodes_for): Likewise. * tree-ssa-coalesce.c (ssa_conflicts_test_p): Likewise. (ssa_conflicts_add): Likewise. * tree-ssa-copy.c (replace_exp): Likewise. * tree-ssa-dom.c (eliminate_redundant_computations): Likewise. * tree-ssa-forwprop.c (simple_gimple_switch): Likewise. * tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise. * tree-ssa-pre.c (bitmap_value_insert_into_set): Likewise. (compute_antic): Likewise. * tree-ssa-ter.c (add_to_partition_kill_list): Likewise. (add_dependence): Likewise. (process_replaceable, kill_expr, find_replaceable_exprs): Likewise. * tree-vrp.c (supports_overflow_infinity): Likewise. (make_overflow_infinity, negative_overflow_infinity): Likewise. (avoid_overflow_infinity, register_new_assert_for): Likewise. (process_assert_insertions_for): Likewise. * var-tracking.c (dv_is_value_p, dv_as_decl, dv_from_decl): Likewise. (dv_from_value, variable_union, find_loc_in_1pdv): Likewise. (intersect_loc_chains, variable_merge_over_cur): Likewise. From-SVN: r165774
-rw-r--r--gcc/ChangeLog46
-rw-r--r--gcc/basic-block.h20
-rw-r--r--gcc/cfghooks.c4
-rw-r--r--gcc/cfglayout.c12
-rw-r--r--gcc/cfgrtl.c4
-rw-r--r--gcc/cgraph.c19
-rw-r--r--gcc/ddg.c5
-rw-r--r--gcc/dwarf2out.c17
-rw-r--r--gcc/emit-rtl.c4
-rw-r--r--gcc/ggc-zone.c4
-rw-r--r--gcc/gimple-iterator.c4
-rw-r--r--gcc/gimple.c4
-rw-r--r--gcc/graphite-scop-detection.c8
-rw-r--r--gcc/haifa-sched.c6
-rw-r--r--gcc/lto-streamer-in.c4
-rw-r--r--gcc/passes.c4
-rw-r--r--gcc/sched-ebb.c16
-rw-r--r--gcc/sel-sched.c12
-rw-r--r--gcc/tree-call-cdce.c4
-rw-r--r--gcc/tree-cfgcleanup.c4
-rw-r--r--gcc/tree-flow-inline.h18
-rw-r--r--gcc/tree-into-ssa.c6
-rw-r--r--gcc/tree-ssa-coalesce.c16
-rw-r--r--gcc/tree-ssa-copy.c10
-rw-r--r--gcc/tree-ssa-dom.c6
-rw-r--r--gcc/tree-ssa-forwprop.c4
-rw-r--r--gcc/tree-ssa-pre.c12
-rw-r--r--gcc/tree-ssa-ter.c22
-rw-r--r--gcc/tree-vrp.c31
-rw-r--r--gcc/var-tracking.c71
30 files changed, 159 insertions, 238 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 10649f9d47d..d9316e0e9f1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,51 @@
2010-10-21 Nathan Froyd <froydnj@codesourcery.com>
+ * basic-block.h (single_succ_edge): Use gcc_checking_assert.
+ (single_pred_edge, ei_container, ei_next, ei_prev): Likewise.
+ * cfghooks.c (fixup_reorder_chain): Likewise.
+ * cfgrtl.c (cfg_layout_merge_blocks): Likewise.
+ * cgraph.c (cgraph_add_thunk): Likewise.
+ (cgraph_create_edge_1): Likewise.
+ (cgraph_create_virtual_clone): Likewise.
+ * ddg.c (add_cross_iteration_register_deps): Likewise.
+ * dwarf2out.c (modified_type_die): Likewise.
+ * emit-rtl.c (set_mem_alias_set): Likewise.
+ * ggc-zone.c (zone_allocate_marks): Likewise.
+ * gimple-iterator.c (gsi_move_to_bb_end): Likewise.
+ * gimple.c (iterative_hash_gimple_type): Likewise.
+ * graphite-scop-detection.c (create_single_entry_edge): Likewise.
+ (create_single_exit_edge): Likewise.
+ * haifa-sched.c (choose_ready): Likewise.
+ * lto-streamer-in.c (input_gimple_stmt): Likewise.
+ * passes.c (execute_todo): Likewise.
+ * sched-ebb.c (begin_schedule_ready): Likewise.
+ * sel-sched.c (code_motion_process_successors): Likewise.
+ * tree-call-cdce.c (gen_conditions_for_pow): Likewise.
+ * tree-cfg-cleanup.c (tree_forwarder_block_p): Likewise.
+ * tree-flow-inline.h (link_imm_use, move_use_after_head): Likewise.
+ (phi_arg_index_from_use, phi_ssa_name_p): Likewise.
+ * tree-into-ssa.c (insert_updated_phi_nodes_for): Likewise.
+ * tree-ssa-coalesce.c (ssa_conflicts_test_p): Likewise.
+ (ssa_conflicts_add): Likewise.
+ * tree-ssa-copy.c (replace_exp): Likewise.
+ * tree-ssa-dom.c (eliminate_redundant_computations): Likewise.
+ * tree-ssa-forwprop.c (simple_gimple_switch): Likewise.
+ * tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise.
+ * tree-ssa-pre.c (bitmap_value_insert_into_set): Likewise.
+ (compute_antic): Likewise.
+ * tree-ssa-ter.c (add_to_partition_kill_list): Likewise.
+ (add_dependence): Likewise.
+ (process_replaceable, kill_expr, find_replaceable_exprs): Likewise.
+ * tree-vrp.c (supports_overflow_infinity): Likewise.
+ (make_overflow_infinity, negative_overflow_infinity): Likewise.
+ (avoid_overflow_infinity, register_new_assert_for): Likewise.
+ (process_assert_insertions_for): Likewise.
+ * var-tracking.c (dv_is_value_p, dv_as_decl, dv_from_decl): Likewise.
+ (dv_from_value, variable_union, find_loc_in_1pdv): Likewise.
+ (intersect_loc_chains, variable_merge_over_cur): Likewise.
+
+2010-10-21 Nathan Froyd <froydnj@codesourcery.com>
+
* cfgloop.c (flow_loops_find): Call bb_has_abnormal_pred.
* reload1.c (has_nonexceptional_receiver): Likewise.
* tree-into-ssa.c (rewrite_update_enter_block): Likewise.
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index e3b6e2007e3..f175208cfd3 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -560,9 +560,7 @@ single_pred_p (const_basic_block bb)
static inline edge
single_succ_edge (const_basic_block bb)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (single_succ_p (bb));
-#endif
+ gcc_checking_assert (single_succ_p (bb));
return EDGE_SUCC (bb, 0);
}
@@ -572,9 +570,7 @@ single_succ_edge (const_basic_block bb)
static inline edge
single_pred_edge (const_basic_block bb)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (single_pred_p (bb));
-#endif
+ gcc_checking_assert (single_pred_p (bb));
return EDGE_PRED (bb, 0);
}
@@ -606,9 +602,7 @@ typedef struct {
static inline VEC(edge,gc) *
ei_container (edge_iterator i)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (i.container);
-#endif
+ gcc_checking_assert (i.container);
return *i.container;
}
@@ -659,9 +653,7 @@ ei_one_before_end_p (edge_iterator i)
static inline void
ei_next (edge_iterator *i)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (i->index < EDGE_COUNT (ei_container (*i)));
-#endif
+ gcc_checking_assert (i->index < EDGE_COUNT (ei_container (*i)));
i->index++;
}
@@ -669,9 +661,7 @@ ei_next (edge_iterator *i)
static inline void
ei_prev (edge_iterator *i)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (i->index > 0);
-#endif
+ gcc_checking_assert (i->index > 0);
i->index--;
}
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index 3532b460851..c6e4bc03313 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -906,9 +906,7 @@ duplicate_block (basic_block bb, edge e, basic_block after)
if (bb->count < new_count)
new_count = bb->count;
-#ifdef ENABLE_CHECKING
- gcc_assert (can_duplicate_block_p (bb));
-#endif
+ gcc_checking_assert (can_duplicate_block_p (bb));
new_bb = cfg_hooks->duplicate_block (bb);
if (after)
diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c
index 9fc05fea854..8a0d35cb619 100644
--- a/gcc/cfglayout.c
+++ b/gcc/cfglayout.c
@@ -828,10 +828,8 @@ fixup_reorder_chain (void)
: label_for_bb (e_fall->dest)), 0))
{
e_fall->flags &= ~EDGE_FALLTHRU;
-#ifdef ENABLE_CHECKING
- gcc_assert (could_fall_through
- (e_taken->src, e_taken->dest));
-#endif
+ gcc_checking_assert (could_fall_through
+ (e_taken->src, e_taken->dest));
e_taken->flags |= EDGE_FALLTHRU;
update_br_prob_note (bb);
e = e_fall, e_fall = e_taken, e_taken = e;
@@ -852,10 +850,8 @@ fixup_reorder_chain (void)
: label_for_bb (e_fall->dest)), 0))
{
e_fall->flags &= ~EDGE_FALLTHRU;
-#ifdef ENABLE_CHECKING
- gcc_assert (could_fall_through
- (e_taken->src, e_taken->dest));
-#endif
+ gcc_checking_assert (could_fall_through
+ (e_taken->src, e_taken->dest));
e_taken->flags |= EDGE_FALLTHRU;
update_br_prob_note (bb);
continue;
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index e46050d02b1..a158112ee05 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -2692,9 +2692,7 @@ cfg_layout_can_merge_blocks_p (basic_block a, basic_block b)
static void
cfg_layout_merge_blocks (basic_block a, basic_block b)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (cfg_layout_can_merge_blocks_p (a, b));
-#endif
+ gcc_checking_assert (cfg_layout_can_merge_blocks_p (a, b));
if (dump_file)
fprintf (dump_file, "merging block %d into block %d\n", b->index, a->index);
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 342ad63562f..e1f47c29dad 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -594,10 +594,9 @@ cgraph_add_thunk (tree alias, tree decl, bool this_adjusting,
node = cgraph_same_body_alias_1 (alias, decl);
gcc_assert (node);
-#ifdef ENABLE_CHECKING
- gcc_assert (!virtual_offset
- || tree_int_cst_equal (virtual_offset, size_int (virtual_value)));
-#endif
+ gcc_checking_assert (!virtual_offset
+ || tree_int_cst_equal (virtual_offset,
+ size_int (virtual_value)));
node->thunk.fixed_offset = fixed_offset;
node->thunk.this_adjusting = this_adjusting;
node->thunk.virtual_value = virtual_value;
@@ -984,11 +983,9 @@ cgraph_create_edge_1 (struct cgraph_node *caller, struct cgraph_node *callee,
have not been loaded yet. */
if (call_stmt)
{
-#ifdef ENABLE_CHECKING
- /* This is rather pricely check possibly trigerring construction of
- call stmt hashtable. */
- gcc_assert (!cgraph_edge (caller, call_stmt));
-#endif
+ /* This is a rather expensive check possibly trigerring
+ construction of call stmt hashtable. */
+ gcc_checking_assert (!cgraph_edge (caller, call_stmt));
gcc_assert (is_gimple_call (call_stmt));
}
@@ -2258,10 +2255,8 @@ cgraph_create_virtual_clone (struct cgraph_node *old_node,
size_t i;
struct ipa_replace_map *map;
-#ifdef ENABLE_CHECKING
if (!flag_wpa)
- gcc_assert (tree_versionable_function_p (old_decl));
-#endif
+ gcc_checking_assert (tree_versionable_function_p (old_decl));
/* Make a new FUNCTION_DECL tree node */
if (!args_to_skip)
diff --git a/gcc/ddg.c b/gcc/ddg.c
index 88aaf9bb2e4..d7b093b9414 100644
--- a/gcc/ddg.c
+++ b/gcc/ddg.c
@@ -262,10 +262,9 @@ add_cross_iteration_register_deps (ddg_ptr g, df_ref last_def)
gcc_assert (last_def_node);
gcc_assert (first_def);
-#ifdef ENABLE_CHECKING
if (DF_REF_ID (last_def) != DF_REF_ID (first_def))
- gcc_assert (!bitmap_bit_p (&bb_info->gen, DF_REF_ID (first_def)));
-#endif
+ gcc_checking_assert (!bitmap_bit_p (&bb_info->gen,
+ DF_REF_ID (first_def)));
/* Create inter-loop true dependences and anti dependences. */
for (r_use = DF_REF_CHAIN (last_def); r_use != NULL; r_use = r_use->next)
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index d19a5cde95c..33a7b561c4d 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -12715,15 +12715,14 @@ modified_type_die (tree type, int is_const_type, int is_volatile_type,
&& TYPE_NAME (qualified_type)
&& TREE_CODE (TYPE_NAME (qualified_type)) == TYPE_DECL)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (TREE_CODE (TREE_TYPE (TYPE_NAME (qualified_type)))
- == INTEGER_TYPE
- && TYPE_PRECISION (TREE_TYPE (TYPE_NAME (qualified_type)))
- == TYPE_PRECISION (qualified_type)
- && TYPE_UNSIGNED (TREE_TYPE (TYPE_NAME (qualified_type)))
- == TYPE_UNSIGNED (qualified_type));
-#endif
- qualified_type = TREE_TYPE (TYPE_NAME (qualified_type));
+ tree t = TREE_TYPE (TYPE_NAME (qualified_type));
+
+ gcc_checking_assert (TREE_CODE (t) == INTEGER_TYPE
+ && TYPE_PRECISION (t)
+ == TYPE_PRECISION (qualified_type)
+ && TYPE_UNSIGNED (t)
+ == TYPE_UNSIGNED (qualified_type));
+ qualified_type = t;
}
/* If we do, then we can just use its DIE, if it exists. */
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 01dd70ab567..19d290c4b2c 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1839,10 +1839,8 @@ set_mem_attributes (rtx ref, tree t, int objectp)
void
set_mem_alias_set (rtx mem, alias_set_type set)
{
-#ifdef ENABLE_CHECKING
/* If the new and old alias sets don't conflict, something is wrong. */
- gcc_assert (alias_sets_conflict_p (set, MEM_ALIAS_SET (mem)));
-#endif
+ gcc_checking_assert (alias_sets_conflict_p (set, MEM_ALIAS_SET (mem)));
MEM_ATTRS (mem) = get_mem_attrs (set, MEM_EXPR (mem), MEM_OFFSET (mem),
MEM_SIZE (mem), MEM_ALIGN (mem),
diff --git a/gcc/ggc-zone.c b/gcc/ggc-zone.c
index 4338bb630d0..7d8420a11b7 100644
--- a/gcc/ggc-zone.c
+++ b/gcc/ggc-zone.c
@@ -802,9 +802,7 @@ zone_allocate_marks (void)
n++;
#endif
}
-#ifdef ENABLE_CHECKING
- gcc_assert (n == zone->n_small_pages);
-#endif
+ gcc_checking_assert (n == zone->n_small_pages);
}
/* We don't collect the PCH zone, but we do have to mark it
diff --git a/gcc/gimple-iterator.c b/gcc/gimple-iterator.c
index 064b7feef49..d654f2fa28d 100644
--- a/gcc/gimple-iterator.c
+++ b/gcc/gimple-iterator.c
@@ -597,9 +597,7 @@ void
gsi_move_to_bb_end (gimple_stmt_iterator *from, basic_block bb)
{
gimple_stmt_iterator last = gsi_last_bb (bb);
-#ifdef ENABLE_CHECKING
- gcc_assert (gsi_bb (last) == bb);
-#endif
+ gcc_checking_assert (gsi_bb (last) == bb);
/* Have to check gsi_end_p because it could be an empty block. */
if (!gsi_end_p (last) && is_ctrl_stmt (gsi_stmt (last)))
diff --git a/gcc/gimple.c b/gcc/gimple.c
index fca78037a0a..6547567bdd4 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -3999,10 +3999,8 @@ iterative_hash_gimple_type (tree type, hashval_t val,
void **slot;
struct sccs *state;
-#ifdef ENABLE_CHECKING
/* Not visited during this DFS walk. */
- gcc_assert (!pointer_map_contains (sccstate, type));
-#endif
+ gcc_checking_assert (!pointer_map_contains (sccstate, type));
state = XOBNEW (sccstate_obstack, struct sccs);
*pointer_map_insert (sccstate, type) = state;
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index 5fae5aae2b1..7110efe0a08 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -899,9 +899,7 @@ create_single_entry_edge (sd_region *region)
single edge pointing from outside into the loop. */
gcc_unreachable ();
-#ifdef ENABLE_CHECKING
- gcc_assert (find_single_entry_edge (region));
-#endif
+ gcc_checking_assert (find_single_entry_edge (region));
}
/* Check if the sd_region, mentioned in EDGE, has no exit bb. */
@@ -967,9 +965,7 @@ create_single_exit_edge (sd_region *region)
if (e->aux)
((sd_region *) e->aux)->exit = forwarder->dest;
-#ifdef ENABLE_CHECKING
- gcc_assert (find_single_exit_edge (region));
-#endif
+ gcc_checking_assert (find_single_exit_edge (region));
}
/* Unmark the exit edges of all REGIONS.
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 015f8b9d557..40f125de3c7 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -2727,14 +2727,12 @@ choose_ready (struct ready_list *ready, rtx *insn_ptr)
{
insn = ready_element (ready, i);
-#ifdef ENABLE_CHECKING
/* If this insn is recognizable we should have already
recognized it earlier.
??? Not very clear where this is supposed to be done.
See dep_cost_1. */
- gcc_assert (INSN_CODE (insn) >= 0
- || recog_memoized (insn) < 0);
-#endif
+ gcc_checking_assert (INSN_CODE (insn) >= 0
+ || recog_memoized (insn) < 0);
ready_try [i]
= (/* INSN_CODE check can be omitted here as it is also done later
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index 72ac6eca2f3..50352e896a2 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -973,9 +973,7 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
to unify some types and thus not find a proper
field-decl here. So only assert here if checking
is enabled. */
-#ifdef ENABLE_CHECKING
- gcc_assert (tem != NULL_TREE);
-#endif
+ gcc_checking_assert (tem != NULL_TREE);
if (tem != NULL_TREE)
TREE_OPERAND (op, 1) = tem;
}
diff --git a/gcc/passes.c b/gcc/passes.c
index 1308ce954f0..1ee3400e0ca 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -1310,9 +1310,7 @@ execute_todo (unsigned int flags)
static void
verify_interpass_invariants (void)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (!fold_deferring_overflow_warnings_p ());
-#endif
+ gcc_checking_assert (!fold_deferring_overflow_warnings_p ());
}
/* Clear the last verified flag. */
diff --git a/gcc/sched-ebb.c b/gcc/sched-ebb.c
index 8e692158013..8090898f8ed 100644
--- a/gcc/sched-ebb.c
+++ b/gcc/sched-ebb.c
@@ -147,24 +147,22 @@ begin_schedule_ready (rtx insn, rtx last)
e = find_fallthru_edge (last_bb->succs);
-#ifdef ENABLE_CHECKING
- gcc_assert (!e || !(e->flags & EDGE_COMPLEX));
+ gcc_checking_assert (!e || !(e->flags & EDGE_COMPLEX));
- gcc_assert (BLOCK_FOR_INSN (insn) == last_bb
- && !IS_SPECULATION_CHECK_P (insn)
- && BB_HEAD (last_bb) != insn
- && BB_END (last_bb) == insn);
+ gcc_checking_assert (BLOCK_FOR_INSN (insn) == last_bb
+ && !IS_SPECULATION_CHECK_P (insn)
+ && BB_HEAD (last_bb) != insn
+ && BB_END (last_bb) == insn);
{
rtx x;
x = NEXT_INSN (insn);
if (e)
- gcc_assert (NOTE_P (x) || LABEL_P (x));
+ gcc_checking_assert (NOTE_P (x) || LABEL_P (x));
else
- gcc_assert (BARRIER_P (x));
+ gcc_checking_assert (BARRIER_P (x));
}
-#endif
if (e)
{
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index d93ebaae5a3..378e561bf59 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -6360,7 +6360,6 @@ code_motion_process_successors (insn_t insn, av_set_t orig_ops,
goto rescan;
}
-#ifdef ENABLE_CHECKING
/* Here, RES==1 if original expr was found at least for one of the
successors. After the loop, RES may happen to have zero value
only if at some point the expr searched is present in av_set, but is
@@ -6368,12 +6367,11 @@ code_motion_process_successors (insn_t insn, av_set_t orig_ops,
The exception is when the original operation is blocked by
bookkeeping generated for another fence or for another path in current
move_op. */
- gcc_assert (res == 1
- || (res == 0
- && av_set_could_be_blocked_by_bookkeeping_p (orig_ops,
- static_params))
- || res == -1);
-#endif
+ gcc_checking_assert (res == 1
+ || (res == 0
+ && av_set_could_be_blocked_by_bookkeeping_p (orig_ops,
+ static_params))
+ || res == -1);
/* Merge data, clean up, etc. */
if (res != -1 && code_motion_path_driver_info->after_merge_succs)
diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c
index 7f0a3e223e9..25476e61a09 100644
--- a/gcc/tree-call-cdce.c
+++ b/gcc/tree-call-cdce.c
@@ -541,9 +541,7 @@ gen_conditions_for_pow (gimple pow_call, VEC (gimple, heap) *conds,
tree base, expn;
enum tree_code bc;
-#ifdef ENABLE_CHECKING
- gcc_assert (check_pow (pow_call));
-#endif
+ gcc_checking_assert (check_pow (pow_call));
*nconds = 0;
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index ae23cfc6ab9..403566edd7d 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -279,9 +279,7 @@ tree_forwarder_block_p (basic_block bb, bool phi_wanted)
|| (single_succ_edge (bb)->flags & EDGE_ABNORMAL))
return false;
-#if ENABLE_CHECKING
- gcc_assert (bb != ENTRY_BLOCK_PTR);
-#endif
+ gcc_checking_assert (bb != ENTRY_BLOCK_PTR);
locus = single_succ_edge (bb)->goto_locus;
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h
index 7103d238b09..1a62cdd1f44 100644
--- a/gcc/tree-flow-inline.h
+++ b/gcc/tree-flow-inline.h
@@ -230,10 +230,8 @@ link_imm_use (ssa_use_operand_t *linknode, tree def)
else
{
root = &(SSA_NAME_IMM_USE_NODE (def));
-#ifdef ENABLE_CHECKING
if (linknode->use)
gcc_checking_assert (*(linknode->use) == def);
-#endif
link_imm_use_to_list (linknode, root);
}
}
@@ -556,13 +554,11 @@ phi_arg_index_from_use (use_operand_p use)
root = gimple_phi_arg (phi, 0);
index = element - root;
-#ifdef ENABLE_CHECKING
/* Make sure the calculation doesn't have any leftover bytes. If it does,
then imm_use is likely not the first element in phi_arg_d. */
- gcc_assert ((((char *)element - (char *)root)
- % sizeof (struct phi_arg_d)) == 0
- && index < gimple_phi_capacity (phi));
-#endif
+ gcc_checking_assert ((((char *)element - (char *)root)
+ % sizeof (struct phi_arg_d)) == 0
+ && index < gimple_phi_capacity (phi));
return index;
}
@@ -613,9 +609,7 @@ phi_ssa_name_p (const_tree t)
{
if (TREE_CODE (t) == SSA_NAME)
return true;
-#ifdef ENABLE_CHECKING
- gcc_assert (is_gimple_min_invariant (t));
-#endif
+ gcc_checking_assert (is_gimple_min_invariant (t));
return false;
}
@@ -975,9 +969,7 @@ static inline use_operand_p
move_use_after_head (use_operand_p use_p, use_operand_p head,
use_operand_p last_p)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (USE_FROM_PTR (use_p) == USE_FROM_PTR (head));
-#endif
+ gcc_checking_assert (USE_FROM_PTR (use_p) == USE_FROM_PTR (head));
/* Skip head when we find it. */
if (use_p != head)
{
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index 8c2b159399d..91b5fc83667 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -2998,12 +2998,10 @@ insert_updated_phi_nodes_for (tree var, bitmap_head *dfs, bitmap blocks,
bitmap_iterator bi;
unsigned i;
-#if defined ENABLE_CHECKING
if (TREE_CODE (var) == SSA_NAME)
- gcc_assert (is_old_name (var));
+ gcc_checking_assert (is_old_name (var));
else
- gcc_assert (symbol_marked_for_renaming (var));
-#endif
+ gcc_checking_assert (symbol_marked_for_renaming (var));
/* Get all the definition sites for VAR. */
db = find_def_blocks_for (var);
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c
index be44d568108..7615612e67b 100644
--- a/gcc/tree-ssa-coalesce.c
+++ b/gcc/tree-ssa-coalesce.c
@@ -547,11 +547,9 @@ ssa_conflicts_test_p (ssa_conflicts_p ptr, unsigned x, unsigned y)
{
bitmap b;
-#ifdef ENABLE_CHECKING
- gcc_assert (x < ptr->size);
- gcc_assert (y < ptr->size);
- gcc_assert (x != y);
-#endif
+ gcc_checking_assert (x < ptr->size);
+ gcc_checking_assert (y < ptr->size);
+ gcc_checking_assert (x != y);
b = ptr->conflicts[x];
if (b)
@@ -579,11 +577,9 @@ ssa_conflicts_add_one (ssa_conflicts_p ptr, unsigned x, unsigned y)
static inline void
ssa_conflicts_add (ssa_conflicts_p ptr, unsigned x, unsigned y)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (x < ptr->size);
- gcc_assert (y < ptr->size);
- gcc_assert (x != y);
-#endif
+ gcc_checking_assert (x < ptr->size);
+ gcc_checking_assert (y < ptr->size);
+ gcc_checking_assert (x != y);
ssa_conflicts_add_one (ptr, x, y);
ssa_conflicts_add_one (ptr, y, x);
}
diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c
index c82943c47aa..a92b63be5f9 100644
--- a/gcc/tree-ssa-copy.c
+++ b/gcc/tree-ssa-copy.c
@@ -211,12 +211,10 @@ replace_exp (use_operand_p op_p, tree val)
void
propagate_tree_value (tree *op_p, tree val)
{
-#if defined ENABLE_CHECKING
- gcc_assert (!(TREE_CODE (val) == SSA_NAME
- && *op_p
- && TREE_CODE (*op_p) == SSA_NAME
- && !may_propagate_copy (*op_p, val)));
-#endif
+ gcc_checking_assert (!(TREE_CODE (val) == SSA_NAME
+ && *op_p
+ && TREE_CODE (*op_p) == SSA_NAME
+ && !may_propagate_copy (*op_p, val)));
if (TREE_CODE (val) == SSA_NAME)
*op_p = val;
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 54a35af4a85..bab6ced1c60 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -1852,10 +1852,8 @@ eliminate_redundant_computations (gimple_stmt_iterator* gsi)
|| useless_type_conversion_p (expr_type, TREE_TYPE (cached_lhs))))
|| may_propagate_copy_into_stmt (stmt, cached_lhs))
{
-#if defined ENABLE_CHECKING
- gcc_assert (TREE_CODE (cached_lhs) == SSA_NAME
- || is_gimple_min_invariant (cached_lhs));
-#endif
+ gcc_checking_assert (TREE_CODE (cached_lhs) == SSA_NAME
+ || is_gimple_min_invariant (cached_lhs));
if (dump_file && (dump_flags & TDF_DETAILS))
{
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index a68755e8b40..f4808e78fff 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -1286,10 +1286,8 @@ simplify_gimple_switch (gimple stmt)
def = gimple_assign_rhs1 (def_stmt);
-#ifdef ENABLE_CHECKING
/* ??? Why was Jeff testing this? We are gimple... */
- gcc_assert (is_gimple_val (def));
-#endif
+ gcc_checking_assert (is_gimple_val (def));
to = TREE_TYPE (cond);
ti = TREE_TYPE (def);
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index d4d108d95ef..8f91bd699b8 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -895,9 +895,7 @@ bitmap_value_insert_into_set (bitmap_set_t set, pre_expr expr)
{
unsigned int val = get_expr_value_id (expr);
-#ifdef ENABLE_CHECKING
- gcc_assert (expr->id == get_or_alloc_expression_id (expr));
-#endif
+ gcc_checking_assert (expr->id == get_or_alloc_expression_id (expr));
/* Constant values are always considered to be part of the set. */
if (value_id_constant_p (val))
@@ -2608,10 +2606,8 @@ compute_antic (void)
block->index));
}
}
-#ifdef ENABLE_CHECKING
/* Theoretically possible, but *highly* unlikely. */
- gcc_assert (num_iterations < 500);
-#endif
+ gcc_checking_assert (num_iterations < 500);
}
statistics_histogram_event (cfun, "compute_antic iterations",
@@ -2640,10 +2636,8 @@ compute_antic (void)
block->index));
}
}
-#ifdef ENABLE_CHECKING
/* Theoretically possible, but *highly* unlikely. */
- gcc_assert (num_iterations < 500);
-#endif
+ gcc_checking_assert (num_iterations < 500);
}
statistics_histogram_event (cfun, "compute_partial_antic iterations",
num_iterations);
diff --git a/gcc/tree-ssa-ter.c b/gcc/tree-ssa-ter.c
index 0fb8028543e..7bd766954fa 100644
--- a/gcc/tree-ssa-ter.c
+++ b/gcc/tree-ssa-ter.c
@@ -296,9 +296,7 @@ add_to_partition_kill_list (temp_expr_table_p tab, int p, int ver)
static inline void
remove_from_partition_kill_list (temp_expr_table_p tab, int p, int version)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (tab->kill_list[p]);
-#endif
+ gcc_checking_assert (tab->kill_list[p]);
bitmap_clear_bit (tab->kill_list[p], version);
if (bitmap_empty_p (tab->kill_list[p]))
{
@@ -345,10 +343,8 @@ add_dependence (temp_expr_table_p tab, int version, tree var)
else
{
i = var_to_partition (tab->map, var);
-#ifdef ENABLE_CHECKING
- gcc_assert (i != NO_PARTITION);
- gcc_assert (tab->num_in_part[i] != 0);
-#endif
+ gcc_checking_assert (i != NO_PARTITION);
+ gcc_checking_assert (tab->num_in_part[i] != 0);
/* Only dependencies on ssa_names which are coalesced with something need
to be tracked. Partitions with containing only a single SSA_NAME
*cannot* have their value changed. */
@@ -479,9 +475,7 @@ process_replaceable (temp_expr_table_p tab, gimple stmt, int call_cnt)
ssa_op_iter iter;
bitmap def_vars, use_vars;
-#ifdef ENABLE_CHECKING
- gcc_assert (is_replaceable_p (stmt));
-#endif
+ gcc_checking_assert (is_replaceable_p (stmt));
def = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_DEF);
version = SSA_NAME_VERSION (def);
@@ -534,9 +528,7 @@ kill_expr (temp_expr_table_p tab, int partition)
finished_with_expr (tab, version, true);
}
-#ifdef ENABLE_CHECKING
- gcc_assert (!tab->kill_list[partition]);
-#endif
+ gcc_checking_assert (!tab->kill_list[partition]);
}
@@ -704,9 +696,7 @@ find_replaceable_exprs (var_map map)
FOR_EACH_BB (bb)
{
find_replaceable_in_bb (table, bb);
-#ifdef ENABLE_CHECKING
- gcc_assert (bitmap_empty_p (table->partition_in_use));
-#endif
+ gcc_checking_assert (bitmap_empty_p (table->partition_in_use));
}
ret = free_temp_expr_table (table);
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index c005c53c902..8ab986ef1bd 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -243,9 +243,7 @@ supports_overflow_infinity (const_tree type)
static inline tree
make_overflow_infinity (tree val)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (val != NULL_TREE && CONSTANT_CLASS_P (val));
-#endif
+ gcc_checking_assert (val != NULL_TREE && CONSTANT_CLASS_P (val));
val = copy_node (val);
TREE_OVERFLOW (val) = 1;
return val;
@@ -256,9 +254,7 @@ make_overflow_infinity (tree val)
static inline tree
negative_overflow_infinity (tree type)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (supports_overflow_infinity (type));
-#endif
+ gcc_checking_assert (supports_overflow_infinity (type));
return make_overflow_infinity (vrp_val_min (type));
}
@@ -267,9 +263,7 @@ negative_overflow_infinity (tree type)
static inline tree
positive_overflow_infinity (tree type)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (supports_overflow_infinity (type));
-#endif
+ gcc_checking_assert (supports_overflow_infinity (type));
return make_overflow_infinity (vrp_val_max (type));
}
@@ -332,9 +326,7 @@ avoid_overflow_infinity (tree val)
return vrp_val_max (TREE_TYPE (val));
else
{
-#ifdef ENABLE_CHECKING
- gcc_assert (vrp_val_is_min (val));
-#endif
+ gcc_checking_assert (vrp_val_is_min (val));
return vrp_val_min (TREE_TYPE (val));
}
}
@@ -4131,13 +4123,11 @@ register_new_assert_for (tree name, tree expr,
assert_locus_t n, loc, last_loc;
basic_block dest_bb;
-#if defined ENABLE_CHECKING
- gcc_assert (bb == NULL || e == NULL);
+ gcc_checking_assert (bb == NULL || e == NULL);
if (e == NULL)
- gcc_assert (gimple_code (gsi_stmt (si)) != GIMPLE_COND
- && gimple_code (gsi_stmt (si)) != GIMPLE_SWITCH);
-#endif
+ gcc_checking_assert (gimple_code (gsi_stmt (si)) != GIMPLE_COND
+ && gimple_code (gsi_stmt (si)) != GIMPLE_SWITCH);
/* Never build an assert comparing against an integer constant with
TREE_OVERFLOW set. This confuses our undefined overflow warning
@@ -5059,10 +5049,9 @@ process_assert_insertions_for (tree name, assert_locus_t loc)
{
/* We have been asked to insert the assertion on an edge. This
is used only by COND_EXPR and SWITCH_EXPR assertions. */
-#if defined ENABLE_CHECKING
- gcc_assert (gimple_code (gsi_stmt (loc->si)) == GIMPLE_COND
- || gimple_code (gsi_stmt (loc->si)) == GIMPLE_SWITCH);
-#endif
+ gcc_checking_assert (gimple_code (gsi_stmt (loc->si)) == GIMPLE_COND
+ || (gimple_code (gsi_stmt (loc->si))
+ == GIMPLE_SWITCH));
gsi_insert_on_edge (loc->e, assert_stmt);
return true;
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index c74ef7cd649..c3d5077dbaf 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -1075,9 +1075,7 @@ dv_is_value_p (decl_or_value dv)
static inline tree
dv_as_decl (decl_or_value dv)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (dv_is_decl_p (dv));
-#endif
+ gcc_checking_assert (dv_is_decl_p (dv));
return (tree) dv;
}
@@ -1085,9 +1083,7 @@ dv_as_decl (decl_or_value dv)
static inline rtx
dv_as_value (decl_or_value dv)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (dv_is_value_p (dv));
-#endif
+ gcc_checking_assert (dv_is_value_p (dv));
return (rtx)dv;
}
@@ -1136,9 +1132,7 @@ dv_from_decl (tree decl)
{
decl_or_value dv;
dv = decl;
-#ifdef ENABLE_CHECKING
- gcc_assert (dv_is_decl_p (dv));
-#endif
+ gcc_checking_assert (dv_is_decl_p (dv));
return dv;
}
@@ -1148,9 +1142,7 @@ dv_from_value (rtx value)
{
decl_or_value dv;
dv = value;
-#ifdef ENABLE_CHECKING
- gcc_assert (dv_is_value_p (dv));
-#endif
+ gcc_checking_assert (dv_is_value_p (dv));
return dv;
}
@@ -2182,10 +2174,8 @@ variable_union (variable src, dataflow_set *set)
nnode->next = dnode;
dnode = nnode;
}
-#ifdef ENABLE_CHECKING
else if (r == 0)
- gcc_assert (rtx_equal_p (dnode->loc, snode->loc));
-#endif
+ gcc_checking_assert (rtx_equal_p (dnode->loc, snode->loc));
if (r >= 0)
snode = snode->next;
@@ -2549,17 +2539,13 @@ find_loc_in_1pdv (rtx loc, variable var, htab_t vars)
if (!var)
return NULL;
-#ifdef ENABLE_CHECKING
- gcc_assert (dv_onepart_p (var->dv));
-#endif
+ gcc_checking_assert (dv_onepart_p (var->dv));
if (!var->n_var_parts)
return NULL;
-#ifdef ENABLE_CHECKING
- gcc_assert (var->var_part[0].offset == 0);
- gcc_assert (loc != dv_as_opaque (var->dv));
-#endif
+ gcc_checking_assert (var->var_part[0].offset == 0);
+ gcc_checking_assert (loc != dv_as_opaque (var->dv));
loc_code = GET_CODE (loc);
for (node = var->var_part[0].loc_chain; node; node = node->next)
@@ -2591,20 +2577,16 @@ find_loc_in_1pdv (rtx loc, variable var, htab_t vars)
while (node->next && GET_CODE (node->next->loc) == VALUE)
{
node = node->next;
-#ifdef ENABLE_CHECKING
- gcc_assert (!canon_value_cmp (node->loc,
- dv_as_value (var->dv)));
-#endif
+ gcc_checking_assert (!canon_value_cmp (node->loc,
+ dv_as_value (var->dv)));
if (loc == node->loc)
return node;
}
continue;
}
-#ifdef ENABLE_CHECKING
- gcc_assert (node == var->var_part[0].loc_chain);
- gcc_assert (!node->next);
-#endif
+ gcc_checking_assert (node == var->var_part[0].loc_chain);
+ gcc_checking_assert (!node->next);
dv = dv_from_value (node->loc);
rvar = (variable) htab_find_with_hash (vars, dv, dv_htab_hash (dv));
@@ -2672,15 +2654,11 @@ intersect_loc_chains (rtx val, location_chain *dest, struct dfset_merge *dsm,
{
location_chain s2node;
-#ifdef ENABLE_CHECKING
- gcc_assert (dv_onepart_p (s2var->dv));
-#endif
+ gcc_checking_assert (dv_onepart_p (s2var->dv));
if (s2var->n_var_parts)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (s2var->var_part[0].offset == 0);
-#endif
+ gcc_checking_assert (s2var->var_part[0].offset == 0);
s2node = s2var->var_part[0].loc_chain;
for (; s1node && s2node;
@@ -2829,10 +2807,8 @@ loc_cmp (rtx x, rtx y)
if (DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (x))
< DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (y)))
return -1;
-#ifdef ENABLE_CHECKING
- gcc_assert (DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (x))
- > DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (y)));
-#endif
+ gcc_checking_assert (DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (x))
+ > DEBUG_TEMP_UID (DEBUG_EXPR_TREE_DECL (y)));
return 1;
}
@@ -3592,10 +3568,9 @@ variable_merge_over_cur (variable s1var, struct dfset_merge *dsm)
dstslot = shared_hash_find_slot_noinsert_1 (dst->vars, dv, dvhash);
gcc_assert (*dstslot == dvar);
canonicalize_values_star (dstslot, dst);
-#ifdef ENABLE_CHECKING
- gcc_assert (dstslot
- == shared_hash_find_slot_noinsert_1 (dst->vars, dv, dvhash));
-#endif
+ gcc_checking_assert (dstslot
+ == shared_hash_find_slot_noinsert_1 (dst->vars,
+ dv, dvhash));
dvar = (variable)*dstslot;
}
else
@@ -3660,11 +3635,9 @@ variable_merge_over_cur (variable s1var, struct dfset_merge *dsm)
dstslot = shared_hash_find_slot_noinsert_1 (dst->vars, dv, dvhash);
gcc_assert (*dstslot == dvar);
canonicalize_values_star (dstslot, dst);
-#ifdef ENABLE_CHECKING
- gcc_assert (dstslot
- == shared_hash_find_slot_noinsert_1 (dst->vars,
- dv, dvhash));
-#endif
+ gcc_checking_assert (dstslot
+ == shared_hash_find_slot_noinsert_1 (dst->vars,
+ dv, dvhash));
dvar = (variable)*dstslot;
}
}