+2004-09-09 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+ Nathan Sidwell <nathan@codesourcery.com>
+
+ * targhooks.c (default_unwind_emit, default_scalar_mode_supported_p):
+ Use gcc_assert, gcc_unreachable & internal_error instead of abort.
+ * timevar.c (timevar_push, timevar_pop, timevar_start,
+ timevar_stop): Likewise.
+ * toplev.c (default_pch_valid_p): Likewise.
+ * tracer.c (tail_duplicate): Likewise.
+ * tree-alias-common.c (get_alias_var_decl,
+ get_values_from_constructor, create_alias_var, delete_alias_vars,
+ empty_points_to_set, same_points_to_set, ptr_may_alias_var):
+ Likewise.
+ * tree.c (tree_size, make_node_stat, copy_node_stat,
+ build_int_cst_wide, integer_all_onesp, list_length, chainon,
+ tree_node_structure, type_contains_placeholder_p, substitute_in_expr,
+ substitute_placeholder_in_expr, tabilize_reference_1, build0_stat,
+ build1_stat, build2_stat, build3_stat, build4_stat, is_attribute_p,
+ lookup_attribute, type_hash_canon, host_integerp, iterative_hash_expr,
+ build_method_type_directly, decl_type_context, get_callee_fndecl,
+ get_set_constructor_bits, build_vector_type_for_mode, int_cst_value,
+ tree_fold_gcd): Likewise.
+ * tree-cfg.c (create_bb, make_ctrl_stmt_edges, make_exit_edges,
+ make_cond_expr_edges, group_case_labels, tree_merge_blocks,
+ cleanup_control_expr_graph, find_taken_edge,
+ find_taken_edge_switch_expr, phi_alternatives_equal,
+ is_ctrl_altering_stmt, disband_implicit_edges, set_bb_for_stmt,
+ stmt_for_bsi, tree_find_edge_insert_loc, bsi_insert_on_edge_immediate,
+ tree_split_edge, tree_verify_flow_info, thread_jumps,
+ tree_redirect_edge_and_branch, tree_flow_call_edges_add): Likewise.
+ * tree-chrec.c (chrec_fold_poly_cst, chrec_fold_plus_poly_poly,
+ chrec_fold_multiply_poly_poly): Likewise.
+ * tree-complex.c (extract_component, expand_complex_division,
+ expand_complex_comparison, expand_complex_operations_1,
+ build_replicated_const, expand_vector_operations_1): Likewise.
+ * tree-data-ref.c (tree_fold_bezout, build_classic_dist_vector,
+ build_classic_dir_vector): Likewise.
+ * tree-dfa.c (compute_immediate_uses_for_phi,
+ compute_immediate_uses_for_stmt, create_var_ann, create_stmt_ann,
+ create_tree_ann, collect_dfa_stats, get_virtual_var): Likewise.
+ * tree-dump.c (dequeue_and_dump): Likewise.
+ * tree-eh.c (record_stmt_eh_region, add_stmt_to_eh_region,
+ record_in_finally_tree, replace_goto_queue_1,
+ maybe_record_in_goto_queue, verify_norecord_switch_expr,
+ do_return_redirection): Likewise.
+ * tree-if-conv.c (tree_if_convert_stmt, tree_if_convert_cond_expr,
+ add_to_dst_predicate_list, find_phi_replacement_condition,
+ replace_phi_with_cond_modify_expr, get_loop_body_in_if_conv_order):
+ Likewise.
+ * tree-inline.c (remap_decl, remap_type, remap_decls, copy_body_r,
+ initialize_inlined_parameters, declare_return_variable,
+ estimate_num_insns_1, expand_call_inline, expand_calls_inline,
+ optimize_inline_calls, copy_tree_r): Likewise.
+ * tree-into-ssa.c (rewrite_initialize_block_local_data, rewrite_stmt,
+ ssa_rewrite_stmt, rewrite_into_ssa): Likewise.
+ * tree-iterator.c (alloc_stmt_list, tsi_link_before, tsi_link_after,
+ tsi_split_statement_list_after, tsi_split_statement_list_before):
+ Likewise.
+ * tree-mudflap.c (mf_varname_tree): Likewise.
+ * tree-nested.c (create_tmp_var_for, lookup_field_for_decl,
+ lookup_tramp_for_decl, convert_all_function_calls): Likewise.
+ * tree-optimize.c (tree_rest_of_compilation): Likewise.
+ * tree-outof-ssa.c (create_temp, eliminate_build, eliminate_phi,
+ coalesce_abnormal_edges, coalesce_ssa_name, eliminate_virtual_phis,
+ free_temp_expr_table, add_dependance, finish_expr, rewrite_trees):
+ Likewise.
+ * tree-phinodes.c (resize_phi_node, add_phi_arg,
+ remove_all_phi_nodes_for): Likewise.
+ * tree-pretty-print.c (op_prio, print_call_name): Likewise.
+ * tree-profile.c (tree_gen_interval_profiler, tree_gen_pow2_profiler,
+ tree_gen_one_value_profiler, tree_gen_const_delta_profiler): Likewise.
+ * tree-sra.c (type_can_instantiate_all_elements, sra_hash_tree,
+ sra_elt_eq, sra_walk_expr, instantiate_missing_elements,
+ generate_one_element_ref, generate_element_copy,
+ generate_element_zero, scalarize_copy, scalarize_init,
+ scalarize_ldst): Likewise.
+ * tree-ssa-alias.c (delete_alias_info, group_aliases, may_alias_p,
+ add_may_alias, add_pointed_to_expr, add_pointed_to_var,
+ collect_points_to_info_r, get_tmt_for, get_ptr_info): Likewise.
+ * tree-ssa.c (walk_use_def_chains, check_phi_redundancy): Likewise.
+ * tree-ssa-ccp.c (dump_lattice_value, get_default_value, get_value,
+ set_lattice_value, likely_value, ccp_visit_phi_node, visit_assignment,
+ widen_bitfield, ccp_fold_builtin): Likewise.
+ * tree-ssa-copy.c (may_propagate_copy, merge_alias_info,
+ replace_exp_1, propagate_tree_value): Likewise.
+ * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise.
+ * tree-ssa-dce.c (set_control_dependence_map_bit,
+ find_control_dependence, find_pdom, mark_operand_necessary,
+ mark_stmt_if_obviously_necessary,
+ mark_control_dependent_edges_necessary, remove_dead_stmt): Likewise.
+ * tree-ssa-dom.c (dom_opt_initialize_block_local_data,
+ simplify_switch_and_lookup_avail_expr, cprop_into_successor_phis,
+ eliminate_redundant_computations, avail_expr_eq): Likewise.
+ * tree-ssa-dse.c (fix_stmt_v_may_defs): Likewise.
+ * tree-ssa-loop-ch.c (should_duplicate_loop_header_p,
+ duplicate_blocks): Likewise.
+ * tree-ssa-loop-im.c (for_each_index, set_level,
+ is_call_clobbered_ref): Likewise.
+ * tree-ssa-loop-ivopts.c (dump_use, divide, stmt_after_ip_normal_pos,
+ stmt_after_increment, set_iv, contains_abnormal_ssa_name_p,
+ find_interesting_uses_outer_or_nonlin, add_derived_ivs_candidates,
+ peel_address, ptr_difference_cost, may_replace_final_value,
+ determine_use_iv_cost, rewrite_use_nonlinear_expr, rewrite_use_outer,
+ rewrite_use, rewrite_uses): Likewise.
+ * tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa,
+ check_loop_closed_ssa_use): Likewise.
+ * tree-ssanames.c (make_ssa_name): Likewise.
+ * tree-ssa-operands.c (finalize_ssa_defs, finalize_ssa_uses,
+ finalize_ssa_v_must_defs, finalize_ssa_stmt_operands,
+ get_stmt_operands, get_expr_operands, get_asm_expr_operands,
+ get_indirect_ref_operands, add_stmt_operand): Likewise.
+ * tree-ssa-pre.c (value_exists_in_set_bitmap,
+ value_remove_from_set_bitmap, bitmap_insert_into_set, insert_into_set,
+ phi_translate, valid_in_set, compute_antic,
+ find_or_generate_expression, create_expression_by_pieces, insert_aux,
+ create_value_expr_from, eliminate): Likewise.
+ * tree-ssa-propagate.c (cfg_blocks_get): Likewise.
+ * tree-ssa-threadupdate.c (remove_last_stmt_and_useless_edges):
+ Likewise.
+ * tree-tailcall.c (independent_of_stmt_p, adjust_return_value,
+ eliminate_tail_call): Likewise.
+ * tree-vectorizer.c (vect_create_index_for_array_ref,
+ vect_align_data_ref, vect_create_data_ref,
+ vect_create_destination_var, vect_get_vec_def_for_operand,
+ vect_finish_stmt_generation, vect_transform_stmt,
+ vect_transform_loop_bound, vect_transform_loop,
+ vect_analyze_operations): Likewise.
+ * tree-vn.c (vn_compute, set_value_handle, get_value_handle):
+ Likewise.
+ * tree-flow-inline.h (var_ann, get_var_ann, get_def_from_ptr,
+ get_use_op_ptr, immediate_use, phi_ssa_name_p, bsi_start,
+ bsi_after_labels, bsi_last): Likewise.
+ * tree-ssa-live.c (var_union, change_partition_var,
+ create_ssa_var_map, calculate_live_on_entry, root_var_init,
+ type_var_init, add_coalesce, sort_coalesce_list, pop_best_coalesce):
+ Likewise.
+ * tree-ssa-live.h (partition_is_global, live_entry_blocks,
+ tpa_find_tree): Likewise.
+ (register_ssa_partition_check): Declare.
+ (register_ssa_partition): use it.
+ * tree-ssa-live.c: Include errors.h.
+ (register_ssa_partition_check): New.
+ * tree-ssa-operands.c: Include errors.h.
+ * Makefile.in (tree-ssa-operands.o): Depend on errors.h.
+
2004-09-09 Richard Sandiford <rsandifo@redhat.com>
Catherine Moore <clm@redhat.com>
tree-alias-common.h convert.h $(TM_H) coretypes.h langhooks.h \
$(TREE_DUMP_H) tree-pass.h params.h
tree-ssa-operands.o : tree-ssa-operands.c $(TREE_FLOW_H) $(CONFIG_H) \
- $(SYSTEM_H) $(TREE_H) $(TM_P_H) $(GGC_H) diagnostic.h \
+ $(SYSTEM_H) $(TREE_H) $(TM_P_H) $(GGC_H) diagnostic.h errors.h \
tree-inline.h $(FLAGS_H) function.h $(TM_H) $(TIMEVAR_H) tree-pass.h
tree-eh.o : tree-eh.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_H) $(FLAGS_H) function.h except.h langhooks.h \
rtx insn ATTRIBUTE_UNUSED)
{
/* Should never happen. */
- abort ();
+ gcc_unreachable ();
}
/* True if MODE is valid for the target. By "valid", we mean able to
return false;
default:
- abort ();
+ gcc_unreachable ();
}
}
tv->used = 1;
/* Can't push a standalone timer. */
- if (tv->standalone)
- abort ();
+ gcc_assert (!tv->standalone);
/* What time is it? */
get_time (&now);
if (!timevar_enable)
return;
- if (&timevars[timevar] != stack->timevar)
- {
- sorry ("cannot timevar_pop '%s' when top of timevars stack is '%s'",
- timevars[timevar].name, stack->timevar->name);
- abort ();
- }
-
+ gcc_assert (&timevars[timevar] == stack->timevar);
+
/* What time is it? */
get_time (&now);
/* Don't allow the same timing variable to be started more than
once. */
- if (tv->standalone)
- abort ();
+ gcc_assert (!tv->standalone);
tv->standalone = 1;
get_time (&tv->start_time);
return;
/* TIMEVAR must have been started via timevar_start. */
- if (!tv->standalone)
- abort ();
+ gcc_assert (tv->standalone);
get_time (&now);
timevar_accumulate (&tv->elapsed, &tv->start_time, &now);
goto make_message;
}
}
- abort ();
+ gcc_unreachable ();
}
data += sizeof (target_flags);
len -= sizeof (target_flags);
if (ignore_bb_p (bb))
continue;
- if (seen (bb))
- abort ();
+ gcc_assert (!seen (bb));
n = find_trace (bb, trace);
get_alias_var_decl (tree decl)
{
alias_var newvar;
- if (TREE_CODE (decl) == FIELD_DECL)
- abort ();
+ gcc_assert (TREE_CODE (decl) != FIELD_DECL);
if (DECL_P (decl))
{
if (DECL_PTA_ALIASVAR (decl))
}
break;
default:
- abort();
+ gcc_unreachable ();
}
}
{
alias_var avar;
- if (!DECL_P (decl))
- abort ();
+ gcc_assert (DECL_P (decl));
- if (DECL_P (decl))
- {
- if (DECL_PTA_ALIASVAR (decl))
- return DECL_PTA_ALIASVAR (decl);
- }
+ if (DECL_PTA_ALIASVAR (decl))
+ return DECL_PTA_ALIASVAR (decl);
if (POINTER_TYPE_P (TREE_TYPE (decl))
&& TREE_CODE (TREE_TYPE (TREE_TYPE (decl))) == FUNCTION_TYPE)
for (i = 0; i < VARRAY_ACTIVE_SIZE (local_alias_vars); i++)
{
tree key = VARRAY_TREE (local_alias_vars, i);
- if (DECL_P (key))
- DECL_PTA_ALIASVAR (key) = NULL;
- else
- abort ();
+ gcc_assert (DECL_P (key));
+ DECL_PTA_ALIASVAR (key) = NULL;
}
for (i = 0; i < VARRAY_ACTIVE_SIZE (local_alias_varnums); i ++)
ptr = TREE_OPERAND (ptr, 1);
#endif
- if (DECL_P (ptr))
- {
- ptrtv = DECL_PTA_ALIASVAR (ptr);
- if (!ptrtv)
- return true;
- }
- else
- abort ();
+ gcc_assert (DECL_P (ptr));
+ ptrtv = DECL_PTA_ALIASVAR (ptr);
+ if (!ptrtv)
+ return true;
return current_alias_ops->empty_points_to_set (current_alias_ops, ptrtv);
}
if (ptr == var)
return true;
- if (DECL_P (ptr))
- {
- ptrtv = DECL_PTA_ALIASVAR (ptr);
- if (!ptrtv)
- return false;
- }
- else
- abort ();
+ gcc_assert (DECL_P (ptr));
+ ptrtv = DECL_PTA_ALIASVAR (ptr);
+ if (!ptrtv)
+ return false;
- if (DECL_P (var))
- {
- vartv = DECL_PTA_ALIASVAR (var);
- if (!vartv)
- return false;
- }
- else
- abort ();
+ gcc_assert (DECL_P (var));
+ vartv = DECL_PTA_ALIASVAR (var);
+ if (!vartv)
+ return false;
return current_alias_ops->same_points_to_set (current_alias_ops, vartv, ptrtv);
}
if (ptr == var)
return true;
- if (DECL_P (ptr))
- {
- ptrtv = DECL_PTA_ALIASVAR (ptr);
- if (!ptrtv)
- return false;
- }
- else
- abort ();
+ gcc_assert (DECL_P (ptr));
+ ptrtv = DECL_PTA_ALIASVAR (ptr);
+ if (!ptrtv)
+ return false;
- if (DECL_P (var))
- {
- vartv = DECL_PTA_ALIASVAR (var);
- if (!vartv)
- return false;
- }
- else
- abort ();
+ gcc_assert (DECL_P (var));
+ vartv = DECL_PTA_ALIASVAR (var);
+ if (!vartv)
+ return false;
return current_alias_ops->may_alias (current_alias_ops, ptrtv, vartv);
}
create_block_annotation (basic_block bb)
{
/* Verify that the tree_annotations field is clear. */
- if (bb->tree_annotations)
- abort ();
+ gcc_assert (!bb->tree_annotations);
bb->tree_annotations = ggc_alloc_cleared (sizeof (struct bb_ann_d));
}
{
basic_block bb;
- if (e)
- abort ();
+ gcc_assert (!e);
/* Create and initialize a new basic block. */
bb = alloc_block ();
{
tree last = last_stmt (bb);
-#if defined ENABLE_CHECKING
- if (last == NULL_TREE)
- abort();
-#endif
-
+ gcc_assert (last);
switch (TREE_CODE (last))
{
case GOTO_EXPR:
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
{
tree last = last_stmt (bb), op;
- if (last == NULL_TREE)
- abort ();
-
+ gcc_assert (last);
switch (TREE_CODE (last))
{
case CALL_EXPR:
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
basic_block then_bb, else_bb;
tree then_label, else_label;
-#if defined ENABLE_CHECKING
- if (entry == NULL_TREE || TREE_CODE (entry) != COND_EXPR)
- abort ();
-#endif
+ gcc_assert (entry);
+ gcc_assert (TREE_CODE (entry) == COND_EXPR);
/* Entry basic blocks for each component. */
then_label = GOTO_DESTINATION (COND_EXPR_THEN (entry));
tree base_case, base_label, base_high, type;
base_case = TREE_VEC_ELT (labels, i);
- if (! base_case)
- abort ();
-
+ gcc_assert (base_case);
base_label = CASE_LABEL (base_case);
/* Discard cases that have the same destination as the
/* Ensure that B follows A. */
move_block_after (b, a);
- if (!(a->succ->flags & EDGE_FALLTHRU))
- abort ();
-
- if (last_stmt (a)
- && stmt_ends_bb_p (last_stmt (a)))
- abort ();
+ gcc_assert (a->succ->flags & EDGE_FALLTHRU);
+ gcc_assert (!last_stmt (a) || !stmt_ends_bb_p (last_stmt (a)));
/* Remove labels from B and set bb_for_stmt to A for other statements. */
for (bsi = bsi_start (b); !bsi_end_p (bsi);)
break;
default:
- abort ();
+ gcc_unreachable ();
}
taken_edge = find_taken_edge (bb, val);
stmt = last_stmt (bb);
-#if defined ENABLE_CHECKING
- if (stmt == NULL_TREE || !is_ctrl_stmt (stmt))
- abort ();
-#endif
+ gcc_assert (stmt);
+ gcc_assert (is_ctrl_stmt (stmt));
/* If VAL is a predicate of the form N RELOP N, where N is an
SSA_NAME, we can always determine its truth value (except when
dest_bb = label_to_block (CASE_LABEL (taken_case));
e = find_edge (bb, dest_bb);
- if (!e)
- abort ();
+ gcc_assert (e);
return e;
}
n1 = phi_arg_from_edge (phi, e1);
n2 = phi_arg_from_edge (phi, e2);
-#ifdef ENABLE_CHECKING
- if (n1 < 0 || n2 < 0)
- abort ();
-#endif
+ gcc_assert (n1 >= 0);
+ gcc_assert (n2 >= 0);
val1 = PHI_ARG_DEF (phi, n1);
val2 = PHI_ARG_DEF (phi, n2);
{
tree call;
-#if defined ENABLE_CHECKING
- if (t == NULL)
- abort ();
-#endif
-
+ gcc_assert (t);
call = get_call_expr_in (t);
if (call)
{
else if (e->flags & EDGE_FALSE_VALUE)
COND_EXPR_ELSE (stmt) = build_empty_stmt ();
else
- abort ();
+ gcc_unreachable ();
e->flags |= EDGE_FALLTHRU;
}
{
/* Remove the RETURN_EXPR if we may fall though to the exit
instead. */
- if (!bb->succ
- || bb->succ->succ_next
- || bb->succ->dest != EXIT_BLOCK_PTR)
- abort ();
+ gcc_assert (bb->succ);
+ gcc_assert (!bb->succ->succ_next);
+ gcc_assert (bb->succ->dest == EXIT_BLOCK_PTR);
if (bb->next_bb == EXIT_BLOCK_PTR
&& !TREE_OPERAND (stmt, 0))
if (!e || e->dest == bb->next_bb)
continue;
- if (e->dest == EXIT_BLOCK_PTR)
- abort ();
-
+ gcc_assert (e->dest != EXIT_BLOCK_PTR);
label = tree_block_label (e->dest);
stmt = build1 (GOTO_EXPR, void_type_node, label);
VARRAY_GROW (label_to_block_map, 3 * uid / 2);
}
else
- {
-#ifdef ENABLE_CHECKING
- /* We're moving an existing label. Make sure that we've
- removed it from the old block. */
- if (bb && VARRAY_BB (label_to_block_map, uid))
- abort ();
-#endif
- }
+ /* We're moving an existing label. Make sure that we've
+ removed it from the old block. */
+ gcc_assert (!bb || !VARRAY_BB (label_to_block_map, uid));
VARRAY_BB (label_to_block_map, uid) = bb;
}
}
if (bsi_stmt (bsi) == stmt)
return bsi;
- abort ();
+ gcc_unreachable ();
}
/* Insert statement (or statement list) T before the statement
tree op = TREE_OPERAND (tmp, 0);
if (!is_gimple_val (op))
{
- if (TREE_CODE (op) != MODIFY_EXPR)
- abort ();
+ gcc_assert (TREE_CODE (op) == MODIFY_EXPR);
bsi_insert_before (bsi, op, BSI_NEW_STMT);
TREE_OPERAND (tmp, 0) = TREE_OPERAND (op, 0);
}
block_stmt_iterator bsi;
basic_block new_bb = NULL;
- if (PENDING_STMT (e))
- abort ();
+ gcc_assert (!PENDING_STMT (e));
if (tree_find_edge_insert_loc (e, &bsi, &new_bb))
bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
int i, num_elem;
/* Abnormal edges cannot be split. */
- if (edge_in->flags & EDGE_ABNORMAL)
- abort ();
+ gcc_assert (!(edge_in->flags & EDGE_ABNORMAL));
src = edge_in->src;
dest = edge_in->dest;
}
}
- if (!redirect_edge_and_branch (edge_in, new_bb))
- abort ();
-
- if (PENDING_STMT (edge_in))
- abort ();
+ e = redirect_edge_and_branch (edge_in, new_bb);
+ gcc_assert (e);
+ gcc_assert (!PENDING_STMT (edge_in));
return new_bb;
}
tree lab = CASE_LABEL (TREE_VEC_ELT (vec, i));
basic_block label_bb = label_to_block (lab);
- if (label_bb->aux && label_bb->aux != (void *)1)
- abort ();
+ gcc_assert (!label_bb->aux || label_bb->aux == (void *)1);
label_bb->aux = (void *)1;
}
for (phi = phi_nodes (dest); phi; phi = PHI_CHAIN (phi))
{
arg = phi_arg_from_edge (phi, last);
- if (arg < 0)
- abort ();
+ gcc_assert (arg >= 0);
add_phi_arg (&phi, PHI_ARG_DEF (phi, arg), e);
}
}
case GOTO_EXPR:
/* No non-abnormal edges should lead from a non-simple goto, and
simple ones should be represented implicitly. */
- abort ();
+ gcc_unreachable ();
case SWITCH_EXPR:
{
default:
/* Otherwise it must be a fallthru edge, and we don't need to
do anything besides redirecting it. */
- if (!(e->flags & EDGE_FALLTHRU))
- abort ();
+ gcc_assert (e->flags & EDGE_FALLTHRU);
break;
}
tree_redirect_edge_and_branch_force (edge e, basic_block dest)
{
e = tree_redirect_edge_and_branch (e, dest);
- if (!e)
- abort ();
+ gcc_assert (e);
return NULL;
}
#ifdef ENABLE_CHECKING
if (stmt == last_stmt)
for (e = bb->succ; e; e = e->succ_next)
- if (e->dest == EXIT_BLOCK_PTR)
- abort ();
+ gcc_assert (e->dest != EXIT_BLOCK_PTR);
#endif
/* Note that the following may create a new basic block
tree poly,
tree cst)
{
-#if defined ENABLE_CHECKING
- if (poly == NULL_TREE
- || cst == NULL_TREE
- || TREE_CODE (poly) != POLYNOMIAL_CHREC
- || is_not_constant_evolution (cst))
- abort ();
-#endif
+ gcc_assert (poly);
+ gcc_assert (cst);
+ gcc_assert (TREE_CODE (poly) == POLYNOMIAL_CHREC);
+ gcc_assert (!is_not_constant_evolution (cst));
switch (code)
{
tree poly1)
{
tree left, right;
-
-#if defined ENABLE_CHECKING
- if (poly0 == NULL_TREE
- || poly1 == NULL_TREE
- || TREE_CODE (poly0) != POLYNOMIAL_CHREC
- || TREE_CODE (poly1) != POLYNOMIAL_CHREC)
- abort ();
-#endif
+
+ gcc_assert (poly0);
+ gcc_assert (poly1);
+ gcc_assert (TREE_CODE (poly0) == POLYNOMIAL_CHREC);
+ gcc_assert (TREE_CODE (poly1) == POLYNOMIAL_CHREC);
/*
{a, +, b}_1 + {c, +, d}_2 -> {{a, +, b}_1 + c, +, d}_2,
tree poly0,
tree poly1)
{
-#if defined ENABLE_CHECKING
- if (poly0 == NULL_TREE
- || poly1 == NULL_TREE
- || TREE_CODE (poly0) != POLYNOMIAL_CHREC
- || TREE_CODE (poly1) != POLYNOMIAL_CHREC)
- abort ();
-#endif
+ gcc_assert (poly0);
+ gcc_assert (poly1);
+ gcc_assert (TREE_CODE (poly0) == POLYNOMIAL_CHREC);
+ gcc_assert (TREE_CODE (poly1) == POLYNOMIAL_CHREC);
/* {a, +, b}_1 * {c, +, d}_2 -> {c*{a, +, b}_1, +, d}_2,
{a, +, b}_2 * {c, +, d}_1 -> {a*{c, +, d}_1, +, b}_2,
break;
default:
- abort ();
+ gcc_unreachable ();
}
return gimplify_val (bsi, inner_type, ret);
break;
default:
/* C99-like requirements for complex divide (not yet implemented). */
- abort ();
+ gcc_unreachable ();
}
}
TREE_OPERAND (stmt, 0) = cc;
break;
default:
- abort ();
+ gcc_unreachable ();
}
modify_stmt (stmt);
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
\f
unsigned HOST_WIDE_INT low, high, mask;
tree ret;
- if (n == 0)
- abort ();
+ gcc_assert (n);
if (width == HOST_BITS_PER_WIDE_INT)
low = value;
else if (TYPE_PRECISION (type) == 2 * HOST_BITS_PER_WIDE_INT)
high = low;
else
- abort ();
+ gcc_unreachable ();
ret = build_int_cst_wide (type, low, high);
return ret;
if (code == NOP_EXPR || code == VIEW_CONVERT_EXPR)
return;
-
- if (code == CONVERT_EXPR)
- abort ();
-
+
+ gcc_assert (code != CONVERT_EXPR);
op = optab_for_tree_code (code, type);
/* Optabs will try converting a negation into a subtraction, so
zs2 = fold (build (MULT_EXPR, integer_type_node, z, s2));
/* row1 -= z * row2. */
+ gcc_assert (sign != 0);
if (sign < 0)
{
*u11 = fold (build (PLUS_EXPR, integer_type_node, *u11, zu21));
*u12 = fold (build (PLUS_EXPR, integer_type_node, *u12, zu22));
s1 = fold (build (PLUS_EXPR, integer_type_node, s1, zs2));
}
- else if (sign > 0)
+ else
{
*u11 = fold (build (MINUS_EXPR, integer_type_node, *u11, zu21));
*u12 = fold (build (MINUS_EXPR, integer_type_node, *u12, zu22));
s1 = fold (build (MINUS_EXPR, integer_type_node, s1, zs2));
}
- else
- /* Should not happen. */
- abort ();
/* Interchange row1 and row2. */
{
/* If the loop number is still greater than the number of
loops we've been asked to analyze, or negative,
something is borked. */
- if (loop_nb < 0 || loop_nb >= nb_loops)
- abort ();
+ gcc_assert (loop_nb >= 0);
+ gcc_assert (loop_nb < nb_loops);
dist = int_cst_value (SUB_DISTANCE (subscript));
/* This is the subscript coupling test.
lca_nb = lca->num;
lca_nb -= first_loop;
- if (lca_nb < 0 || lca_nb >= nb_loops)
- abort ();
+ gcc_assert (lca_nb >= 0);
+ gcc_assert (lca_nb < nb_loops);
/* For each outer loop where init_v is not set, the accesses are
in dependence of distance 1 in the loop. */
if (lca != loop_a
lca_nb = lca->num - first_loop;
while (lca->depth != 0)
{
- if (lca_nb < 0 || lca_nb >= nb_loops)
- abort ();
+ gcc_assert (lca_nb >= 0);
+ gcc_assert (lca_nb < nb_loops);
if (init_v[lca_nb] == 0)
dist_v[lca_nb] = 1;
lca = lca->outer;
/* If the loop number is still greater than the number of
loops we've been asked to analyze, or negative,
something is borked. */
- if (loop_nb < 0 || loop_nb >= nb_loops)
- abort ();
- if (chrec_contains_undetermined (SUB_DISTANCE (subscript)))
- {
-
- }
- else
+ gcc_assert (loop_nb >= 0);
+ gcc_assert (loop_nb < nb_loops);
+ if (!chrec_contains_undetermined (SUB_DISTANCE (subscript)))
{
int dist = int_cst_value (SUB_DISTANCE (subscript));
lca = find_common_loop (loop_a, loop_b);
lca_nb = lca->num - first_loop;
- if (lca_nb < 0 || lca_nb >= nb_loops)
- abort ();
+ gcc_assert (lca_nb >= 0);
+ gcc_assert (lca_nb < nb_loops);
/* For each outer loop where init_v is not set, the accesses are
in dependence of distance 1 in the loop. */
if (lca != loop_a
lca_nb = lca->num - first_loop;
while (lca->depth != 0)
{
- if (lca_nb < 0 || lca_nb >= nb_loops)
- abort ();
+ gcc_assert (lca_nb >= 0);
+ gcc_assert (lca_nb < nb_loops);
if (init_v[lca_nb] == 0)
dir_v[lca_nb] = dir_positive;
lca = lca->outer;
{
int i;
-#ifdef ENABLE_CHECKING
- if (TREE_CODE (phi) != PHI_NODE)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (phi) == PHI_NODE);
for (i = 0; i < PHI_NUM_ARGS (phi); i++)
{
tree use;
ssa_op_iter iter;
-#ifdef ENABLE_CHECKING
/* PHI nodes are handled elsewhere. */
- if (TREE_CODE (stmt) == PHI_NODE)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (stmt) != PHI_NODE);
/* Look at USE_OPS or VUSE_OPS according to FLAGS. */
if (flags & TDFA_USE_OPS)
{
var_ann_t ann;
-#if defined ENABLE_CHECKING
- if (t == NULL_TREE
- || !DECL_P (t)
- || (t->common.ann
- && t->common.ann->common.type != VAR_ANN))
- abort ();
-#endif
+ gcc_assert (t);
+ gcc_assert (DECL_P (t));
+ gcc_assert (!t->common.ann || t->common.ann->common.type == VAR_ANN);
ann = ggc_alloc (sizeof (*ann));
memset ((void *) ann, 0, sizeof (*ann));
{
stmt_ann_t ann;
-#if defined ENABLE_CHECKING
- if ((!is_gimple_stmt (t))
- || (t->common.ann
- && t->common.ann->common.type != STMT_ANN))
- abort ();
-#endif
+ gcc_assert (is_gimple_stmt (t));
+ gcc_assert (!t->common.ann || t->common.ann->common.type == STMT_ANN);
ann = ggc_alloc (sizeof (*ann));
memset ((void *) ann, 0, sizeof (*ann));
{
tree_ann_t ann;
-#if defined ENABLE_CHECKING
- if (t == NULL_TREE
- || (t->common.ann
- && t->common.ann->common.type != TREE_ANN_COMMON))
- abort ();
-#endif
+ gcc_assert (t);
+ gcc_assert (!t->common.ann || t->common.ann->common.type == TREE_ANN_COMMON);
ann = ggc_alloc (sizeof (*ann));
memset ((void *) ann, 0, sizeof (*ann));
basic_block bb;
block_stmt_iterator i;
- if (dfa_stats_p == NULL)
- abort ();
+ gcc_assert (dfa_stats_p);
memset ((void *)dfa_stats_p, 0, sizeof (struct dfa_stats_d));
|| handled_component_p (var))
var = TREE_OPERAND (var, 0);
-#ifdef ENABLE_CHECKING
/* Treating GIMPLE registers as virtual variables makes no sense.
Also complain if we couldn't extract a _DECL out of the original
expression. */
- if (!SSA_VAR_P (var)
- || is_gimple_reg (var))
- abort ();
-#endif
+ gcc_assert (SSA_VAR_P (var));
+ gcc_assert (!is_gimple_reg (var));
return var;
}
else if (access == access_private_node)
string = "priv";
else
- abort ();
+ gcc_unreachable ();
dump_string (di, string);
queue_and_dump_index (di, "binf", base, DUMP_BINFO);
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
else if (DECL_P (t))
n->region_nr = get_eh_region_number (region);
slot = htab_find_slot (throw_stmt_table, n, INSERT);
- if (*slot)
- abort ();
+ gcc_assert (!*slot);
*slot = n;
}
struct throw_stmt_node *n;
void **slot;
- if (num < 0)
- abort ();
+ gcc_assert (num >= 0);
n = ggc_alloc (sizeof (*n));
n->stmt = t;
n->region_nr = num;
slot = htab_find_slot (throw_stmt_table, n, INSERT);
- if (*slot)
- abort ();
+ gcc_assert (!*slot);
*slot = n;
}
n->parent = parent;
slot = htab_find_slot (finally_tree, n, INSERT);
- if (*slot)
- abort ();
+ gcc_assert (!*slot);
*slot = n;
}
break;
case STATEMENT_LIST:
- abort ();
+ gcc_unreachable ();
default:
/* These won't have gotos in them. */
break;
default:
- abort ();
+ gcc_unreachable ();
}
active = tf->goto_queue_active;
for (i = 0; i < n; ++i)
{
tree lab = CASE_LABEL (TREE_VEC_ELT (vec, i));
- if (outside_finally_tree (lab, tf->try_finally_expr))
- abort ();
+ gcc_assert (!outside_finally_tree (lab, tf->try_finally_expr));
}
}
#else
depends, I guess, but it does make generation of the switch in
lower_try_finally_switch easier. */
- if (TREE_CODE (ret_expr) == RESULT_DECL)
+ switch (TREE_CODE (ret_expr))
{
+ case RESULT_DECL:
if (!*return_value_p)
*return_value_p = ret_expr;
- else if (*return_value_p != ret_expr)
- abort ();
- q->cont_stmt = q->stmt;
- }
- else if (TREE_CODE (ret_expr) == MODIFY_EXPR)
- {
- tree result = TREE_OPERAND (ret_expr, 0);
- tree new, old = TREE_OPERAND (ret_expr, 1);
-
- if (!*return_value_p)
- {
- if (aggregate_value_p (TREE_TYPE (result),
- TREE_TYPE (current_function_decl)))
- /* If this function returns in memory, copy the argument
- into the return slot now. Otherwise, we might need to
- worry about magic return semantics, so we need to use a
- temporary to hold the value until we're actually ready
- to return. */
- new = result;
- else
- new = create_tmp_var (TREE_TYPE (old), "rettmp");
- *return_value_p = new;
- }
else
- new = *return_value_p;
+ gcc_assert (*return_value_p == ret_expr);
+ q->cont_stmt = q->stmt;
+ break;
- x = build (MODIFY_EXPR, TREE_TYPE (new), new, old);
- append_to_statement_list (x, &q->repl_stmt);
+ case MODIFY_EXPR:
+ {
+ tree result = TREE_OPERAND (ret_expr, 0);
+ tree new, old = TREE_OPERAND (ret_expr, 1);
+
+ if (!*return_value_p)
+ {
+ if (aggregate_value_p (TREE_TYPE (result),
+ TREE_TYPE (current_function_decl)))
+ /* If this function returns in memory, copy the argument
+ into the return slot now. Otherwise, we might need to
+ worry about magic return semantics, so we need to use a
+ temporary to hold the value until we're actually ready
+ to return. */
+ new = result;
+ else
+ new = create_tmp_var (TREE_TYPE (old), "rettmp");
+ *return_value_p = new;
+ }
+ else
+ new = *return_value_p;
+
+ x = build (MODIFY_EXPR, TREE_TYPE (new), new, old);
+ append_to_statement_list (x, &q->repl_stmt);
+
+ if (new == result)
+ x = result;
+ else
+ x = build (MODIFY_EXPR, TREE_TYPE (result), result, new);
+ q->cont_stmt = build1 (RETURN_EXPR, void_type_node, x);
+ }
- if (new == result)
- x = result;
- else
- x = build (MODIFY_EXPR, TREE_TYPE (result), result, new);
- q->cont_stmt = build1 (RETURN_EXPR, void_type_node, x);
+ default:
+ gcc_unreachable ();
}
- else
- abort ();
}
else
{
static inline var_ann_t
var_ann (tree t)
{
-#if defined ENABLE_CHECKING
- if (t == NULL_TREE
- || !DECL_P (t)
- || (t->common.ann
- && t->common.ann->common.type != VAR_ANN))
- abort ();
-#endif
+ gcc_assert (t);
+ gcc_assert (DECL_P (t));
+ gcc_assert (!t->common.ann || t->common.ann->common.type == VAR_ANN);
return (var_ann_t) t->common.ann;
}
static inline stmt_ann_t
stmt_ann (tree t)
{
-#if defined ENABLE_CHECKING
- if (!is_gimple_stmt (t))
- abort ();
+#ifdef ENABLE_CHECKING
+ gcc_assert (is_gimple_stmt (t));
#endif
-
return (stmt_ann_t) t->common.ann;
}
static inline use_operand_p
get_use_op_ptr (use_optype uses, unsigned int index)
{
-#ifdef ENABLE_CHECKING
- if (index >= uses->num_uses)
- abort();
-#endif
+ gcc_assert (index < uses->num_uses);
return uses->uses[index];
}
static inline def_operand_p
get_def_op_ptr (def_optype defs, unsigned int index)
{
-#ifdef ENABLE_CHECKING
- if (index >= defs->num_defs)
- abort();
-#endif
+ gcc_assert (index < defs->num_defs);
return defs->defs[index];
}
get_v_may_def_result_ptr(v_may_def_optype v_may_defs, unsigned int index)
{
def_operand_p op;
-#ifdef ENABLE_CHECKING
- if (index >= v_may_defs->num_v_may_defs)
- abort();
-#endif
+ gcc_assert (index < v_may_defs->num_v_may_defs);
op.def = &(v_may_defs->v_may_defs[index].def);
return op;
}
get_v_may_def_op_ptr(v_may_def_optype v_may_defs, unsigned int index)
{
use_operand_p op;
-#ifdef ENABLE_CHECKING
- if (index >= v_may_defs->num_v_may_defs)
- abort();
-#endif
+ gcc_assert (index < v_may_defs->num_v_may_defs);
op.use = &(v_may_defs->v_may_defs[index].use);
return op;
}
get_vuse_op_ptr(vuse_optype vuses, unsigned int index)
{
use_operand_p op;
-#ifdef ENABLE_CHECKING
- if (index >= vuses->num_vuses)
- abort();
-#endif
+ gcc_assert (index < vuses->num_vuses);
op.use = &(vuses->vuses[index]);
return op;
}
get_v_must_def_op_ptr (v_must_def_optype v_must_defs, unsigned int index)
{
def_operand_p op;
-#ifdef ENABLE_CHECKING
- if (index >= v_must_defs->num_v_must_defs)
- abort();
-#endif
+ gcc_assert (index < v_must_defs->num_v_must_defs);
op.def = &(v_must_defs->v_must_defs[index]);
return op;
}
return NULL_TREE;
#ifdef ENABLE_CHECKING
- if (num >= num_immediate_uses (df))
- abort ();
+ gcc_assert (num < num_immediate_uses (df));
#endif
if (num < 2)
return df->uses[num];
phi_arg_from_edge (tree phi, edge e)
{
int i;
-#if defined ENABLE_CHECKING
- if (!phi || TREE_CODE (phi) != PHI_NODE)
- abort();
-#endif
+ gcc_assert (phi);
+ gcc_assert (TREE_CODE (phi) == PHI_NODE);
for (i = 0; i < PHI_NUM_ARGS (phi); i++)
if (PHI_ARG_EDGE (phi, i) == e)
if (TREE_CODE (t) == SSA_NAME)
return true;
#ifdef ENABLE_CHECKING
- if (!is_gimple_min_invariant (t))
- abort ();
+ gcc_assert (is_gimple_min_invariant (t));
#endif
return false;
}
bsi.tsi = tsi_start (bb->stmt_list);
else
{
-#ifdef ENABLE_CHECKING
- if (bb->index >= 0)
- abort ();
-#endif
+ gcc_assert (bb->index < 0);
bsi.tsi.ptr = NULL;
bsi.tsi.container = NULL;
}
if (!bb->stmt_list)
{
-#ifdef ENABLE_CHECKING
- if (bb->index >= 0)
- abort ();
-#endif
+ gcc_assert (bb->index < 0);
bsi.tsi.ptr = NULL;
bsi.tsi.container = NULL;
return bsi;
be placed at the start of the basic block. This would not work if the
first statement was not label; rather fail here than enable the user
proceed in wrong way. */
- if (TREE_CODE (tsi_stmt (bsi.tsi)) != LABEL_EXPR)
- abort ();
+ gcc_assert (TREE_CODE (tsi_stmt (bsi.tsi)) == LABEL_EXPR);
next = bsi.tsi;
tsi_next (&next);
bsi.tsi = tsi_last (bb->stmt_list);
else
{
-#ifdef ENABLE_CHECKING
- if (bb->index >= 0)
- abort ();
-#endif
+ gcc_assert (bb->index < 0);
bsi.tsi.ptr = NULL;
bsi.tsi.container = NULL;
}
break;
default:
- abort ();
- break;
+ gcc_unreachable ();
}
return cond;
}
tree then_clause, else_clause, c, new_cond;
new_cond = NULL_TREE;
-#ifdef ENABLE_CHECKING
- if (TREE_CODE (stmt) != COND_EXPR)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (stmt) == COND_EXPR);
c = TREE_OPERAND (stmt, 0);
then_clause = TREE_OPERAND (stmt, 1);
basic_block bb;
tree new_cond = NULL_TREE;
-#ifdef ENABLE_CHECKING
- if (TREE_CODE (dst) != GOTO_EXPR)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (dst) == GOTO_EXPR);
bb = label_to_block (TREE_OPERAND (dst, 0));
if (!flow_bb_inside_loop_p (loop, bb))
return NULL_TREE;
{
if (p1 == NULL)
p1 = e->src;
- else if (p2 == NULL)
- p2 = e->src;
- else
- /* More than two predecessors. This is not expected. */
- abort ();
+ else
+ {
+ gcc_assert (!p2);
+ p2 = e->src;
+ }
}
/* Use condition that is not TRUTH_NOT_EXPR in conditional modify expr. */
*cond = TREE_OPERAND (new_stmt, 0);
}
-#ifdef ENABLE_CHECKING
- if (*cond == NULL_TREE)
- abort ();
-#endif
+ gcc_assert (*cond);
return true_bb;
}
basic_block bb;
tree rhs;
tree arg_0, arg_1;
-
-#ifdef ENABLE_CHECKING
- if (TREE_CODE (phi) != PHI_NODE)
- abort ();
+ gcc_assert (TREE_CODE (phi) == PHI_NODE);
+
/* If this is not filtered earlier, then now it is too late. */
- if (PHI_NUM_ARGS (phi) != 2)
- abort ();
-#endif
+ gcc_assert (PHI_NUM_ARGS (phi) == 2);
/* Find basic block and initialize iterator. */
bb = bb_for_stmt (phi);
unsigned int index = 0;
unsigned int visited_count = 0;
- if (!loop->num_nodes)
- abort ();
-
- if (loop->latch == EXIT_BLOCK_PTR)
- abort ();
+ gcc_assert (loop->num_nodes);
+ gcc_assert (loop->latch != EXIT_BLOCK_PTR);
blocks = xcalloc (loop->num_nodes, sizeof (basic_block));
visited = BITMAP_XMALLOC ();
{
tree member = remap_decl (TREE_VALUE (src), id);
- if (TREE_PURPOSE (src))
- abort ();
+ gcc_assert (!TREE_PURPOSE (src));
members = tree_cons (NULL, member, members);
}
DECL_ANON_UNION_ELEMS (t) = nreverse (members);
case OFFSET_TYPE:
default:
/* Shouldn't have been thought variable sized. */
- abort ();
+ gcc_unreachable ();
}
walk_tree (&TYPE_SIZE (new), copy_body_r, id, NULL);
already declared somewhere else, so don't declare it here. */
if (!new_var || new_var == id->retvar)
;
-#ifdef ENABLE_CHECKING
- else if (!DECL_P (new_var))
- abort ();
-#endif
else
{
+ gcc_assert (DECL_P (new_var));
TREE_CHAIN (new_var) = new_decls;
new_decls = new_var;
}
what function they come from. */
if ((TREE_CODE (*tp) == VAR_DECL || TREE_CODE (*tp) == LABEL_DECL)
&& DECL_NAMESPACE_SCOPE_P (*tp))
- if (! DECL_EXTERNAL (*tp) && ! TREE_STATIC (*tp))
- abort ();
+ gcc_assert (DECL_EXTERNAL (*tp) || TREE_STATIC (*tp));
#endif
/* If this is a RETURN_EXPR, change it into a MODIFY_EXPR and a
/* Remap the declaration. */
new_decl = remap_decl (*tp, id);
- if (! new_decl)
- abort ();
+ gcc_assert (new_decl);
/* Replace this variable with the copy. */
STRIP_TYPE_NOPS (new_decl);
*tp = new_decl;
}
-#if 0
- else if (nonstatic_local_decl_p (*tp)
- && DECL_CONTEXT (*tp) != VARRAY_TREE (id->fns, 0))
- abort ();
-#endif
else if (TREE_CODE (*tp) == STATEMENT_LIST)
copy_statement_list (tp);
else if (TREE_CODE (*tp) == SAVE_EXPR)
= splay_tree_lookup (id->decl_map,
(splay_tree_key) TREE_OPERAND (*tp, 0));
/* We _must_ have seen the enclosing LABELED_BLOCK_EXPR. */
- if (! n)
- abort ();
+ gcc_assert (n);
*tp = copy_node (*tp);
TREE_OPERAND (*tp, 0) = (tree) n->value;
}
for (node = id->node->next_clone; node; node = node->next_clone)
{
edge = cgraph_edge (node, old_node);
- if (edge)
- edge->call_expr = *tp;
- else
- abort ();
+ gcc_assert (edge);
+ edge->call_expr = *tp;
}
}
else
if (p)
{
/* No static chain? Seems like a bug in tree-nested.c. */
- if (!static_chain)
- abort ();
+ gcc_assert (static_chain);
- setup_one_parameter (id, p, static_chain, fn, &init_stmts, &vars,
- &gimplify_init_stmts_p);
+ setup_one_parameter (id, p, static_chain, fn, &init_stmts, &vars,
+ &gimplify_init_stmts_p);
}
if (gimplify_init_stmts_p)
{
/* The front end shouldn't have used both return_slot_addr and
a modify expression. */
- if (modify_dest)
- abort ();
+ gcc_assert (!modify_dest);
if (DECL_BY_REFERENCE (result))
var = return_slot_addr;
else
}
/* All types requiring non-trivial constructors should have been handled. */
- if (TREE_ADDRESSABLE (callee_type))
- abort ();
+ gcc_assert (!TREE_ADDRESSABLE (callee_type));
/* Attempt to avoid creating a new temporary variable. */
if (modify_dest)
}
}
- if (TREE_CODE (TYPE_SIZE_UNIT (callee_type)) != INTEGER_CST)
- abort ();
+ gcc_assert (TREE_CODE (TYPE_SIZE_UNIT (callee_type)) == INTEGER_CST);
var = copy_decl_for_inlining (result, callee, caller);
DECL_SEEN_IN_BIND_EXPR_P (var) = 1;
}
default:
/* Abort here se we know we don't miss any nodes. */
- abort ();
+ gcc_unreachable ();
}
return NULL;
}
where previous inlining turned indirect call into direct call by
constant propagating arguments. In all other cases we hit a bug
(incorrect node sharing is most common reason for missing edges. */
- if (!dest->needed)
- abort ();
+ gcc_assert (dest->needed);
cgraph_create_edge (id->node, dest, t)->inline_failed
= N_("originally indirect function call not considered for inlining");
goto egress;
DECL_CONTEXT (id->ret_label) = VARRAY_TREE (id->fns, 0);
insert_decl_map (id, id->ret_label, id->ret_label);
- if (! DECL_INITIAL (fn)
- || TREE_CODE (DECL_INITIAL (fn)) != BLOCK)
- abort ();
+ gcc_assert (DECL_INITIAL (fn));
+ gcc_assert (TREE_CODE (DECL_INITIAL (fn)) == BLOCK);
/* Find the lhs to which the result of this call is assigned. */
modify_dest = tsi_stmt (id->tsi);
case COMPOUND_EXPR:
/* We're gimple. We should have gotten rid of all these. */
- abort ();
+ gcc_unreachable ();
case RETURN_EXPR:
stmt_p = &TREE_OPERAND (stmt, 0);
/* Double check that we inlined everything we are supposed to inline. */
for (e = id.node->callees; e; e = e->next_callee)
- if (!e->inline_failed)
- abort ();
+ gcc_assert (e->inline_failed);
}
#endif
}
*walk_subtrees = 0;
else if (TREE_CODE_CLASS (code) == 'd')
*walk_subtrees = 0;
- else if (code == STATEMENT_LIST)
- abort ();
-
+ else
+ gcc_assert (code != STATEMENT_LIST);
return NULL_TREE;
}
basic_block bb ATTRIBUTE_UNUSED,
bool recycled ATTRIBUTE_UNUSED)
{
-#ifdef ENABLE_CHECKING
struct rewrite_block_data *bd
= (struct rewrite_block_data *)VARRAY_TOP_GENERIC_PTR (walk_data->block_data_stack);
not cleared, then we are re-using a previously allocated entry. In
that case, we can also re-use the underlying virtual arrays. Just
make sure we clear them before using them! */
- if (recycled && bd->block_defs && VARRAY_ACTIVE_SIZE (bd->block_defs) > 0)
- abort ();
-#endif
+ gcc_assert (!recycled || !bd->block_defs || !(VARRAY_ACTIVE_SIZE (bd->block_defs) > 0));
}
fprintf (dump_file, "\n");
}
-#if defined ENABLE_CHECKING
/* We have just scanned the code for operands. No statement should
be modified. */
- if (ann->modified)
- abort ();
-#endif
+ gcc_assert (!ann->modified);
/* Step 1. Rewrite USES and VUSES in the statement. */
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
fprintf (dump_file, "\n");
}
-#if defined ENABLE_CHECKING
/* We have just scanned the code for operands. No statement should
be modified. */
- if (ann->modified)
- abort ();
-#endif
+ gcc_assert (!ann->modified);
/* Step 1. Rewrite USES and VUSES in the statement. */
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
else
{
/* Initialize the array of variables to rename. */
-
- if (vars_to_rename == NULL)
- abort ();
+ gcc_assert (vars_to_rename);
if (bitmap_first_set_bit (vars_to_rename) < 0)
{
void
free_stmt_list (tree t)
{
-#ifdef ENABLE_CHECKING
- if (STATEMENT_LIST_HEAD (t) || STATEMENT_LIST_TAIL (t))
- abort ();
-#endif
+ gcc_assert (!STATEMENT_LIST_HEAD (t));
+ gcc_assert (!STATEMENT_LIST_TAIL (t));
TREE_CHAIN (t) = stmt_list_cache;
stmt_list_cache = t;
}
struct tree_statement_list_node *head, *tail, *cur;
/* Die on looping. */
- if (t == i->container)
- abort ();
+ gcc_assert (t != i->container);
if (TREE_CODE (t) == STATEMENT_LIST)
{
/* Empty statement lists need no work. */
if (!head || !tail)
{
- if (head != tail)
- abort ();
+ gcc_assert (head == tail);
return;
}
}
}
else
{
- if (STATEMENT_LIST_TAIL (i->container))
- abort ();
+ gcc_assert (!STATEMENT_LIST_TAIL (i->container));
STATEMENT_LIST_HEAD (i->container) = head;
STATEMENT_LIST_TAIL (i->container) = tail;
}
i->ptr = tail;
break;
case TSI_SAME_STMT:
- if (!cur)
- abort ();
+ gcc_assert (cur);
break;
}
}
struct tree_statement_list_node *head, *tail, *cur;
/* Die on looping. */
- if (t == i->container)
- abort ();
+ gcc_assert (t != i->container);
if (TREE_CODE (t) == STATEMENT_LIST)
{
/* Empty statement lists need no work. */
if (!head || !tail)
{
- if (head != tail)
- abort ();
+ gcc_assert (head == tail);
return;
}
}
}
else
{
- if (STATEMENT_LIST_TAIL (i->container))
- abort ();
+ gcc_assert (!STATEMENT_LIST_TAIL (i->container));
STATEMENT_LIST_HEAD (i->container) = head;
STATEMENT_LIST_TAIL (i->container) = tail;
}
i->ptr = tail;
break;
case TSI_SAME_STMT:
- if (!cur)
- abort ();
+ gcc_assert (cur);
break;
}
}
cur = i->ptr;
/* How can we possibly split after the end, or before the beginning? */
- if (cur == NULL)
- abort ();
+ gcc_assert (cur);
next = cur->next;
old_sl = i->container;
cur = i->ptr;
/* How can we possibly split after the end, or before the beginning? */
- if (cur == NULL)
- abort ();
+ gcc_assert (cur);
prev = cur->prev;
old_sl = i->container;
const char *buf_contents;
tree result;
- if (decl == NULL_TREE)
- abort ();
+ gcc_assert (decl);
if (!initialized)
{
{
tree tmp_var;
-#if defined ENABLE_CHECKING
/* If the type is of variable size or a type which must be created by the
frontend, something is wrong. Note that we explicitly allow
incomplete types here, since we create them ourselves here. */
- if (TREE_ADDRESSABLE (type)
- || (TYPE_SIZE_UNIT (type)
- && TREE_CODE (TYPE_SIZE_UNIT (type)) != INTEGER_CST))
- abort ();
-#endif
+ gcc_assert (TREE_ADDRESSABLE (type));
+ gcc_assert (!TYPE_SIZE_UNIT (type)
+ || TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST);
tmp_var = create_tmp_var_raw (type, prefix);
DECL_CONTEXT (tmp_var) = info->context;
slot = htab_find_slot (info->var_map, &dummy, insert);
if (!slot)
{
- if (insert == INSERT)
- abort ();
+ gcc_assert (insert != INSERT);
return NULL;
}
elt = *slot;
slot = htab_find_slot (info->var_map, &dummy, insert);
if (!slot)
{
- if (insert == INSERT)
- abort ();
+ gcc_assert (insert != INSERT);
return NULL;
}
elt = *slot;
if (root->outer && !root->chain_decl && !root->chain_field)
DECL_NO_STATIC_CHAIN (root->context) = 1;
else
- {
-#ifdef ENABLE_CHECKING
- if (DECL_NO_STATIC_CHAIN (root->context))
- abort ();
-#endif
- }
+ gcc_assert (!DECL_NO_STATIC_CHAIN (root->context));
root = root->next;
}
timevar_push (TV_EXPAND);
- if (flag_unit_at_a_time && !cgraph_global_info_ready)
- abort ();
+ gcc_assert (!flag_unit_at_a_time || cgraph_global_info_ready);
/* Initialize the RTL code for the function. */
current_function_decl = fndecl;
if (TREE_CODE (t) == SSA_NAME)
t = SSA_NAME_VAR (t);
-
- if (TREE_CODE (t) != VAR_DECL
- && TREE_CODE (t) != PARM_DECL)
- abort ();
+
+ gcc_assert (TREE_CODE (t) == VAR_DECL || TREE_CODE (t) == PARM_DECL);
type = TREE_TYPE (t);
tmp = DECL_NAME (t);
in the same order as all of the other PHI nodes. If they don't
match, find the appropriate index here. */
pi = phi_arg_from_edge (phi, g->e);
- if (pi == -1)
- abort();
+ gcc_assert (pi != -1);
Ti = PHI_ARG_DEF (phi, pi);
}
int x;
basic_block B = e->dest;
-#if defined ENABLE_CHECKING
- if (i == -1)
- abort ();
- if (VARRAY_ACTIVE_SIZE (g->const_copies) != 0)
- abort ();
-#endif
+ gcc_assert (i != -1);
+ gcc_assert (VARRAY_ACTIVE_SIZE (g->const_copies) == 0);
/* Abnormal edges already have everything coalesced, or the coalescer
would have aborted. */
continue;
y = phi_arg_from_edge (phi, e);
- if (y == -1)
- abort ();
+ gcc_assert (y != -1);
tmp = PHI_ARG_DEF (phi, y);
+#ifdef ENABLE_CHECKING
if (!phi_ssa_name_p (tmp))
{
print_exprs_edge (stderr, e,
"\nConstant argument in PHI. Can't insert :",
var, " = ", tmp);
- abort ();
+ internal_error ("SSA corruption");
}
+#else
+ gcc_assert (phi_ssa_name (tmp));
+#endif
y = var_to_partition (map, tmp);
- if (x == NO_PARTITION || y == NO_PARTITION)
- abort ();
+ gcc_assert (x != NO_PARTITION);
+ gcc_assert (y != NO_PARTITION);
+#ifdef ENABLE_CHECKING
if (root_var_find (rv, x) != root_var_find (rv, y))
{
print_exprs_edge (stderr, e, "\nDifferent root vars: ",
root_var (rv, root_var_find (rv, x)),
" and ",
root_var (rv, root_var_find (rv, y)));
- abort ();
+ internal_error ("SSA corruption");
}
+#else
+ gcc_assert (root_var_find (rv, x) == root_var_find (rv, y));
+#endif
if (x != y)
{
- if (!conflict_graph_conflict_p (graph, x, y))
- {
- /* Now map the partitions back to their real variables. */
- var = partition_to_var (map, x);
- tmp = partition_to_var (map, y);
- if (dump_file
- && (dump_flags & TDF_DETAILS))
- {
- print_exprs_edge (dump_file, e,
- "ABNORMAL: Coalescing ",
- var, " and ", tmp);
- }
- if (var_union (map, var, tmp) == NO_PARTITION)
- {
- print_exprs_edge (stderr, e, "\nUnable to coalesce",
- partition_to_var (map, x), " and ",
- partition_to_var (map, y));
- abort ();
- }
- conflict_graph_merge_regs (graph, x, y);
- }
- else
+#ifdef ENABLE_CHECKING
+ if (conflict_graph_conflict_p (graph, x, y))
{
print_exprs_edge (stderr, e, "\n Conflict ",
partition_to_var (map, x),
" and ", partition_to_var (map, y));
- abort ();
+ internal_error ("SSA corruption");
}
+#else
+ gcc_assert (!conflict_graph_conflict_p (graph, x, y));
+#endif
+
+ /* Now map the partitions back to their real variables. */
+ var = partition_to_var (map, x);
+ tmp = partition_to_var (map, y);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ print_exprs_edge (dump_file, e,
+ "ABNORMAL: Coalescing ",
+ var, " and ", tmp);
+ }
+#ifdef ENABLE_CHECKING
+ if (var_union (map, var, tmp) == NO_PARTITION)
+ {
+ print_exprs_edge (stderr, e, "\nUnable to coalesce",
+ partition_to_var (map, x), " and ",
+ partition_to_var (map, y));
+ internal_error ("SSA corruption");
+ }
+#else
+ gcc_assert (var_union (map, var, tmp) != NO_PARTITION);
+#endif
+ conflict_graph_merge_regs (graph, x, y);
}
}
}
/* If these aren't already coalesced... */
if (partition_to_var (map, x) != var)
{
- if (ann->out_of_ssa_tag)
- {
- /* This root variable has already been assigned to another
- partition which is not coalesced with this one. */
- abort ();
- }
+ /* This root variable should have not already been assigned
+ to another partition which is not coalesced with this one. */
+ gcc_assert (!ann->out_of_ssa_tag);
if (dump_file && (dump_flags & TDF_DETAILS))
{
print_generic_expr (stderr, arg, TDF_SLIM);
fprintf (stderr, "), but the result is :");
print_generic_stmt (stderr, phi, TDF_SLIM);
- abort();
+ internal_error ("SSA corruption");
}
}
#endif
int x;
for (x = 0; x <= num_var_partitions (t->map); x++)
if (t->partition_dep_list[x] != NULL)
- abort();
+ gcc_unreachable ();
#endif
while ((p = t->free_list))
else
{
i = var_to_partition (tab->map, var);
-#ifdef ENABLE_CHECKING
- if (i== NO_PARTITION)
- abort ();
-#endif
+ gcc_assert (i != NO_PARTITION);
add_value_to_list (tab, &(tab->partition_dep_list[i]), version);
add_value_to_list (tab,
(value_expr_p *)&(tab->version_info[version]), i);
for (info = (value_expr_p) tab->version_info[version]; info; info = tmp)
{
partition = info->value;
-#ifdef ENABLE_CHECKING
- if (tab->partition_dep_list[partition] == NULL)
- abort ();
-#endif
+ gcc_assert (tab->partition_dep_list[partition]);
tmp = remove_value_from_list (&(tab->partition_dep_list[partition]),
version);
-#ifdef ENABLE_CHECKING
- if (!tmp)
- abort ();
-#endif
+ gcc_assert (tmp);
free_value_expr (tab, tmp);
/* Only clear the bit when the dependency list is emptied via
a replacement. Otherwise kill_expr will take care of it. */
}
else
{
-#ifdef ENABLE_CHECKING
- if (bitmap_bit_p (tab->replaceable, version))
- abort ();
-#endif
+ gcc_assert (!bitmap_bit_p (tab->replaceable, version));
tab->version_info[version] = NULL;
}
}
print_generic_expr (stderr, arg, TDF_SLIM);
fprintf (stderr, "), but the result is not :");
print_generic_stmt (stderr, phi, TDF_SLIM);
- abort();
+ internal_error ("SSA corruption");
}
}
}
int size, old_size;
tree new_phi;
int i, old_len, bucket = NUM_BUCKETS - 2;
-
-#ifdef ENABLE_CHECKING
- if (len < PHI_ARG_CAPACITY (*phi))
- abort ();
-#endif
-
+
+ gcc_assert (len >= PHI_ARG_CAPACITY (*phi));
+
/* Note that OLD_SIZE is guaranteed to be smaller than SIZE. */
old_size = (sizeof (struct tree_phi_node)
+ (PHI_ARG_CAPACITY (*phi) - 1) * sizeof (struct phi_arg_d));
p = PHI_CHAIN (p))
;
- if (!p)
- abort ();
-
+ gcc_assert (p);
PHI_CHAIN (p) = *phi;
}
}
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
tree var = SSA_NAME_VAR (PHI_RESULT (phi));
- if (bitmap_bit_p (vars, var_ann (var)->uid))
- abort ();
+ gcc_assert (!bitmap_bit_p (vars, var_ann (var)->uid));
}
#endif
}
static const char *
op_symbol (tree op)
{
- if (op == NULL)
- abort ();
+ gcc_assert (op);
switch (TREE_CODE (op))
{
{
tree op0;
- if (TREE_CODE (node) != CALL_EXPR)
- abort ();
+ gcc_assert (TREE_CODE (node) == CALL_EXPR);
op0 = TREE_OPERAND (node, 0);
unsigned base ATTRIBUTE_UNUSED)
{
/* FIXME implement this. */
- abort ();
+#ifdef ENABLE_CHECKING
+ internal_error ("unimplemented functionality");
+#endif
+ gcc_unreachable ();
}
/* Output instructions as GIMPLE trees to increment the power of two histogram
unsigned base ATTRIBUTE_UNUSED)
{
/* FIXME implement this. */
- abort ();
+#ifdef ENABLE_CHECKING
+ internal_error ("unimplemented functionality");
+#endif
+ gcc_unreachable ();
}
/* Output instructions as GIMPLE trees for code to find the most common value.
unsigned base ATTRIBUTE_UNUSED)
{
/* FIXME implement this. */
- abort ();
+#ifdef ENABLE_CHECKING
+ internal_error ("unimplemented functionality");
+#endif
+ gcc_unreachable ();
}
/* Output instructions as GIMPLE trees for code to find the most common value
unsigned base ATTRIBUTE_UNUSED)
{
/* FIXME implement this. */
- abort ();
+#ifdef ENABLE_CHECKING
+ internal_error ("unimplemented functionality");
+#endif
+ gcc_unreachable ();
}
/* Return 1 if tree-based profiling is in effect, else 0.
return true;
default:
- abort ();
+ gcc_unreachable ();
}
}
break;
default:
- abort ();
+ gcc_unreachable ();
}
return h;
return fields_compatible_p (ae, be);
default:
- abort ();
+ gcc_unreachable ();
}
}
default:
#ifdef ENABLE_CHECKING
/* Validate that we're not missing any references. */
- if (walk_tree (&inner, sra_find_candidate_decl, NULL, NULL))
- abort ();
+ gcc_assert (!walk_tree (&inner, sra_find_candidate_decl, NULL, NULL));
#endif
return;
}
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
return build (IMAGPART_EXPR, elt->type, base);
default:
- abort ();
+ gcc_unreachable ();
}
}
for (dc = dst->children; dc ; dc = dc->sibling)
{
sc = lookup_element (src, dc->element, NULL, NO_INSERT);
- if (sc == NULL)
- abort ();
+ gcc_assert (sc);
generate_element_copy (dc, sc, list_p);
}
{
tree t;
- if (src->replacement == NULL)
- abort ();
+ gcc_assert (src->replacement);
t = build (MODIFY_EXPR, void_type_node, dst->replacement,
src->replacement);
{
tree t;
- if (elt->is_scalar)
- t = build_int_cst (elt->type, 0);
- else
- /* We generated a replacement for a non-scalar? */
- abort ();
+ gcc_assert (elt->is_scalar);
+ t = build_int_cst (elt->type, 0);
t = build (MODIFY_EXPR, void_type_node, elt->replacement, t);
append_to_statement_list (t, list_p);
/* If we have two scalar operands, modify the existing statement. */
stmt = bsi_stmt (*bsi);
-#ifdef ENABLE_CHECKING
/* See the commentary in sra_walk_function concerning
RETURN_EXPR, and why we should never see one here. */
- if (TREE_CODE (stmt) != MODIFY_EXPR)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (stmt) == MODIFY_EXPR);
TREE_OPERAND (stmt, 0) = lhs_elt->replacement;
TREE_OPERAND (stmt, 1) = rhs_elt->replacement;
list = NULL;
generate_element_copy (lhs_elt, rhs_elt, &list);
- if (list == NULL)
- abort ();
+ gcc_assert (list);
sra_replace (bsi, list);
}
}
{
/* The LHS is fully instantiated. The list of initializations
replaces the original structure assignment. */
- if (!list)
- abort ();
+ gcc_assert (list);
mark_all_v_defs (bsi_stmt (*bsi));
sra_replace (bsi, list);
}
block_stmt_iterator *bsi, bool is_output)
{
/* Shouldn't have gotten called for a scalar. */
- if (elt->replacement)
- abort ();
+ gcc_assert (!elt->replacement);
if (elt->use_block_copy)
{
mark_all_v_defs (stmt);
generate_copy_inout (elt, is_output, other, &list);
- if (list == NULL)
- abort ();
+ gcc_assert (list);
/* Preserve EH semantics. */
if (stmt_ends_bb_p (stmt))
static void
collect_points_to_info_for (struct alias_info *ai, tree ptr)
{
-#if defined ENABLE_CHECKING
- if (!POINTER_TYPE_P (TREE_TYPE (ptr)))
- abort ();
-#endif
+ gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)));
if (!bitmap_bit_p (ai->ssa_names_visited, SSA_NAME_VERSION (ptr)))
{
{
tree new_alias;
-#if defined ENABLE_CHECKING
- if (VARRAY_ACTIVE_SIZE (ann->may_aliases) != 1)
- abort ();
-#endif
+ gcc_assert (VARRAY_ACTIVE_SIZE (ann->may_aliases) == 1);
+
new_alias = VARRAY_TREE (ann->may_aliases, 0);
replace_may_alias (name_tag, j, new_alias);
}
v_ann = var_ann (var);
m_ann = var_ann (mem);
-#if defined ENABLE_CHECKING
- if (m_ann->mem_tag_kind != TYPE_TAG)
- abort ();
-#endif
+ gcc_assert (m_ann->mem_tag_kind == TYPE_TAG);
alias_stats.tbaa_queries++;
var_ann_t v_ann = get_var_ann (var);
var_ann_t a_ann = get_var_ann (alias);
-#if defined ENABLE_CHECKING
- if (var == alias)
- abort ();
-#endif
+ gcc_assert (var != alias);
if (v_ann->may_aliases == NULL)
VARRAY_TREE_INIT (v_ann->may_aliases, 2, "aliases");
if (TREE_CODE (value) == WITH_SIZE_EXPR)
value = TREE_OPERAND (value, 0);
-#if defined ENABLE_CHECKING
/* Pointer variables should have been handled by merge_pointed_to_info. */
- if (TREE_CODE (value) == SSA_NAME
- && POINTER_TYPE_P (TREE_TYPE (value)))
- abort ();
-#endif
+ gcc_assert (TREE_CODE (value) != SSA_NAME
+ || !POINTER_TYPE_P (TREE_TYPE (value)));
get_ptr_info (ptr);
tree pt_var;
size_t uid;
-#if defined ENABLE_CHECKING
- if (TREE_CODE (value) != ADDR_EXPR)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (value) == ADDR_EXPR);
pt_var = TREE_OPERAND (value, 0);
if (TREE_CODE_CLASS (TREE_CODE (pt_var)) == 'r')
fprintf (dump_file, "\n");
}
- if (TREE_CODE (stmt) == MODIFY_EXPR)
+ switch (TREE_CODE (stmt))
{
- tree rhs = TREE_OPERAND (stmt, 1);
- STRIP_NOPS (rhs);
-
- /* Found P_i = ADDR_EXPR */
- if (TREE_CODE (rhs) == ADDR_EXPR)
- add_pointed_to_var (ai, var, rhs);
-
- /* Found P_i = Q_j. */
- else if (TREE_CODE (rhs) == SSA_NAME
- && POINTER_TYPE_P (TREE_TYPE (rhs)))
- merge_pointed_to_info (ai, var, rhs);
+ case MODIFY_EXPR:
+ {
+ tree rhs = TREE_OPERAND (stmt, 1);
+ STRIP_NOPS (rhs);
- /* Found P_i = PLUS_EXPR or P_i = MINUS_EXPR */
- else if (TREE_CODE (rhs) == PLUS_EXPR
- || TREE_CODE (rhs) == MINUS_EXPR)
- {
- tree op0 = TREE_OPERAND (rhs, 0);
- tree op1 = TREE_OPERAND (rhs, 1);
+ /* Found P_i = ADDR_EXPR */
+ if (TREE_CODE (rhs) == ADDR_EXPR)
+ add_pointed_to_var (ai, var, rhs);
- /* Both operands may be of pointer type. FIXME: Shouldn't
- we just expect PTR + OFFSET always? */
- if (POINTER_TYPE_P (TREE_TYPE (op0)))
- {
- if (TREE_CODE (op0) == SSA_NAME)
- merge_pointed_to_info (ai, var, op0);
- else if (TREE_CODE (op0) == ADDR_EXPR)
- add_pointed_to_var (ai, var, op0);
- else
- add_pointed_to_expr (var, op0);
- }
-
- if (POINTER_TYPE_P (TREE_TYPE (op1)))
- {
- if (TREE_CODE (op1) == SSA_NAME)
- merge_pointed_to_info (ai, var, op1);
- else if (TREE_CODE (op1) == ADDR_EXPR)
- add_pointed_to_var (ai, var, op1);
- else
- add_pointed_to_expr (var, op1);
- }
+ /* Found P_i = Q_j. */
+ else if (TREE_CODE (rhs) == SSA_NAME
+ && POINTER_TYPE_P (TREE_TYPE (rhs)))
+ merge_pointed_to_info (ai, var, rhs);
- /* Neither operand is a pointer? VAR can be pointing
- anywhere. FIXME: Is this right? If we get here, we
- found PTR = INT_CST + INT_CST. */
- if (!POINTER_TYPE_P (TREE_TYPE (op0))
- && !POINTER_TYPE_P (TREE_TYPE (op1)))
- add_pointed_to_expr (var, rhs);
- }
+ /* Found P_i = PLUS_EXPR or P_i = MINUS_EXPR */
+ else if (TREE_CODE (rhs) == PLUS_EXPR
+ || TREE_CODE (rhs) == MINUS_EXPR)
+ {
+ tree op0 = TREE_OPERAND (rhs, 0);
+ tree op1 = TREE_OPERAND (rhs, 1);
+
+ /* Both operands may be of pointer type. FIXME: Shouldn't
+ we just expect PTR + OFFSET always? */
+ if (POINTER_TYPE_P (TREE_TYPE (op0)))
+ {
+ if (TREE_CODE (op0) == SSA_NAME)
+ merge_pointed_to_info (ai, var, op0);
+ else if (TREE_CODE (op0) == ADDR_EXPR)
+ add_pointed_to_var (ai, var, op0);
+ else
+ add_pointed_to_expr (var, op0);
+ }
+
+ if (POINTER_TYPE_P (TREE_TYPE (op1)))
+ {
+ if (TREE_CODE (op1) == SSA_NAME)
+ merge_pointed_to_info (ai, var, op1);
+ else if (TREE_CODE (op1) == ADDR_EXPR)
+ add_pointed_to_var (ai, var, op1);
+ else
+ add_pointed_to_expr (var, op1);
+ }
+
+ /* Neither operand is a pointer? VAR can be pointing
+ anywhere. FIXME: Is this right? If we get here, we
+ found PTR = INT_CST + INT_CST. */
+ if (!POINTER_TYPE_P (TREE_TYPE (op0))
+ && !POINTER_TYPE_P (TREE_TYPE (op1)))
+ add_pointed_to_expr (var, rhs);
+ }
- /* Something else. */
- else
- add_pointed_to_expr (var, rhs);
- }
- else if (TREE_CODE (stmt) == ASM_EXPR)
- {
+ /* Something else. */
+ else
+ add_pointed_to_expr (var, rhs);
+ break;
+ }
+ case ASM_EXPR:
/* Pointers defined by __asm__ statements can point anywhere. */
set_pt_anything (var);
- }
- else if (IS_EMPTY_STMT (stmt))
- {
- tree decl = SSA_NAME_VAR (var);
+ break;
- if (TREE_CODE (decl) == PARM_DECL)
- add_pointed_to_expr (var, decl);
- else if (DECL_INITIAL (decl))
- add_pointed_to_var (ai, var, DECL_INITIAL (decl));
- else
- add_pointed_to_expr (var, decl);
- }
- else if (TREE_CODE (stmt) == PHI_NODE)
- {
- /* It STMT is a PHI node, then VAR is one of its arguments. The
- variable that we are analyzing is the LHS of the PHI node. */
- tree lhs = PHI_RESULT (stmt);
-
- if (TREE_CODE (var) == ADDR_EXPR)
- add_pointed_to_var (ai, lhs, var);
- else if (TREE_CODE (var) == SSA_NAME)
- merge_pointed_to_info (ai, lhs, var);
- else if (is_gimple_min_invariant (var))
- add_pointed_to_expr (lhs, var);
- else
- abort ();
- }
- else
- abort ();
+ case NOP_EXPR:
+ if (IS_EMPTY_STMT (stmt))
+ {
+ tree decl = SSA_NAME_VAR (var);
+
+ if (TREE_CODE (decl) == PARM_DECL)
+ add_pointed_to_expr (var, decl);
+ else if (DECL_INITIAL (decl))
+ add_pointed_to_var (ai, var, DECL_INITIAL (decl));
+ else
+ add_pointed_to_expr (var, decl);
+ }
+ break;
+ case PHI_NODE:
+ {
+ /* It STMT is a PHI node, then VAR is one of its arguments. The
+ variable that we are analyzing is the LHS of the PHI node. */
+ tree lhs = PHI_RESULT (stmt);
+ switch (TREE_CODE (var))
+ {
+ case ADDR_EXPR:
+ add_pointed_to_var (ai, lhs, var);
+ break;
+
+ case SSA_NAME:
+ merge_pointed_to_info (ai, lhs, var);
+ break;
+
+ default:
+ gcc_assert (is_gimple_min_invariant (var));
+ add_pointed_to_expr (lhs, var);
+ break;
+ }
+ break;
+ }
+ default:
+ gcc_unreachable ();
+ }
+
return false;
}
ai->pointers[ai->num_pointers++] = alias_map;
}
-#if defined ENABLE_CHECKING
/* Make sure that the type tag has the same alias set as the
pointed-to type. */
- if (tag_set != get_alias_set (tag))
- abort ();
-#endif
-
+ gcc_assert (tag_set == get_alias_set (tag));
return tag;
}
{
struct ptr_info_def *pi;
-#if defined ENABLE_CHECKING
- if (!POINTER_TYPE_P (TREE_TYPE (t)))
- abort ();
-#endif
+ gcc_assert (POINTER_TYPE_P (TREE_TYPE (t)));
pi = SSA_NAME_PTR_INFO (t);
if (pi == NULL)
print_generic_expr (outf, val.const_val, dump_flags);
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
sym = SSA_NAME_VAR (var);
else
{
-#ifdef ENABLE_CHECKING
- if (!DECL_P (var))
- abort ();
-#endif
+ gcc_assert (DECL_P (var));
sym = var;
}
{
value *val;
-#if defined ENABLE_CHECKING
- if (TREE_CODE (var) != SSA_NAME)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (var) == SSA_NAME);
val = &value_vector[SSA_NAME_VERSION (var)];
if (val->lattice_val == UNINITIALIZED)
{
value *old = get_value (var);
-#ifdef ENABLE_CHECKING
if (val.lattice_val == UNDEFINED)
{
/* CONSTANT->UNDEFINED is never a valid state transition. */
- if (old->lattice_val == CONSTANT)
- abort ();
+ gcc_assert (old->lattice_val != CONSTANT);
/* UNKNOWN_VAL->UNDEFINED is never a valid state transition. */
- if (old->lattice_val == UNKNOWN_VAL)
- abort ();
+ gcc_assert (old->lattice_val != UNKNOWN_VAL);
/* VARYING->UNDEFINED is generally not a valid state transition,
except for values which are initialized to VARYING. */
- if (old->lattice_val == VARYING
- && get_default_value (var).lattice_val != VARYING)
- abort ();
+ gcc_assert (old->lattice_val != VARYING
+ || get_default_value (var).lattice_val == VARYING);
}
else if (val.lattice_val == CONSTANT)
- {
- /* VARYING -> CONSTANT is an invalid state transition, except
- for objects which start off in a VARYING state. */
- if (old->lattice_val == VARYING
- && get_default_value (var).lattice_val != VARYING)
- abort ();
- }
-#endif
+ /* VARYING -> CONSTANT is an invalid state transition, except
+ for objects which start off in a VARYING state. */
+ gcc_assert (old->lattice_val == VARYING
+ || get_default_value (var).lattice_val != VARYING);
/* If the constant for VAR has changed, then this VAR is really varying. */
if (old->lattice_val == CONSTANT
if (val->lattice_val == UNKNOWN_VAL)
return UNKNOWN_VAL;
-#ifdef ENABLE_CHECKING
- /* There should be no VUSE operands that are UNDEFINED. */
- if (val->lattice_val == UNDEFINED)
- abort ();
-#endif
+ /* There should be no VUSE operands that are UNDEFINED. */
+ gcc_assert (val->lattice_val != UNDEFINED);
if (val->lattice_val == CONSTANT)
found_constant = 1;
break;
default:
- abort ();
+ gcc_unreachable ();
}
for (i = 0; i < PHI_NUM_ARGS (phi); i++)
vuses = STMT_VUSE_OPS (stmt);
v_must_defs = STMT_V_MUST_DEF_OPS (stmt);
-#if defined ENABLE_CHECKING
- if (NUM_V_MAY_DEFS (STMT_V_MAY_DEF_OPS (stmt)) > 0
- || (NUM_V_MUST_DEFS (v_must_defs) != 1
- && TREE_CODE (lhs) != SSA_NAME))
- abort ();
-#endif
+ gcc_assert (NUM_V_MAY_DEFS (STMT_V_MAY_DEF_OPS (stmt)) == 0);
+ gcc_assert (NUM_V_MUST_DEFS (v_must_defs) == 1
+ || TREE_CODE (lhs) == SSA_NAME);
/* We require the SSA version number of the lhs for the value_vector.
Make sure we have it. */
if (field_size > HOST_BITS_PER_WIDE_INT || var_size > HOST_BITS_PER_WIDE_INT)
return NULL_TREE;
-#if defined ENABLE_CHECKING
- if (var_size < field_size)
- abort ();
-#endif
+ gcc_assert (var_size >= field_size);
/* If the sign bit of the value is not set or the field's type is unsigned,
just mask off the high order bits of the value. */
break;
default:
- abort ();
+ gcc_unreachable ();
}
if (result && ignore)
#ifdef ENABLE_CHECKING
/* If we have one real and one virtual operand, then something has
gone terribly wrong. */
- if (is_gimple_reg (orig))
- abort ();
+ gcc_assert (!is_gimple_reg (orig));
#endif
}
var_ann_t new_ann = var_ann (new_sym);
var_ann_t orig_ann = var_ann (orig_sym);
+ gcc_assert (POINTER_TYPE_P (TREE_TYPE (orig)));
+ gcc_assert (POINTER_TYPE_P (TREE_TYPE (new)));
#if defined ENABLE_CHECKING
- if (!POINTER_TYPE_P (TREE_TYPE (orig))
- || !POINTER_TYPE_P (TREE_TYPE (new))
- || !lang_hooks.types_compatible_p (TREE_TYPE (orig), TREE_TYPE (new)))
- abort ();
+ gcc_assert (lang_hooks.types_compatible_p (TREE_TYPE (orig),
+ TREE_TYPE (new)));
/* If the pointed-to alias sets are different, these two pointers
would never have the same memory tag. In this case, NEW should
not have been propagated into ORIG. */
- if (get_alias_set (TREE_TYPE (TREE_TYPE (new_sym)))
- != get_alias_set (TREE_TYPE (TREE_TYPE (orig_sym))))
- abort ();
+ gcc_assert (get_alias_set (TREE_TYPE (TREE_TYPE (new_sym)))
+ == get_alias_set (TREE_TYPE (TREE_TYPE (orig_sym))));
#endif
/* Merge type-based alias info. */
new_ann->type_mem_tag = orig_ann->type_mem_tag;
else if (orig_ann->type_mem_tag == NULL_TREE)
orig_ann->type_mem_tag = new_ann->type_mem_tag;
- else if (new_ann->type_mem_tag != orig_ann->type_mem_tag)
- abort ();
+ else
+ gcc_assert (new_ann->type_mem_tag == orig_ann->type_mem_tag);
}
tree op = USE_FROM_PTR (op_p);
#if defined ENABLE_CHECKING
- if (for_propagation
- && TREE_CODE (op) == SSA_NAME
- && TREE_CODE (val) == SSA_NAME
- && !may_propagate_copy (op, val))
- abort ();
+ gcc_assert (!(for_propagation
+ && TREE_CODE (op) == SSA_NAME
+ && TREE_CODE (val) == SSA_NAME
+ && !may_propagate_copy (op, val)));
#endif
if (TREE_CODE (val) == SSA_NAME)
propagate_tree_value (tree *op_p, tree val)
{
#if defined ENABLE_CHECKING
- if (TREE_CODE (val) == SSA_NAME
- && TREE_CODE (*op_p) == SSA_NAME
- && !may_propagate_copy (*op_p, val))
- abort ();
+ gcc_assert (!(TREE_CODE (val) == SSA_NAME
+ && TREE_CODE (*op_p) == SSA_NAME
+ && !may_propagate_copy (*op_p, val)));
#endif
if (TREE_CODE (val) == SSA_NAME)
var_ann_t ann1, ann2, ann3;
bool ign1, ign2;
-#ifdef ENABLE_CHECKING
- if (TREE_CODE (var1) != SSA_NAME || TREE_CODE (var2) != SSA_NAME)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (var1) == SSA_NAME);
+ gcc_assert (TREE_CODE (var2) == SSA_NAME);
register_ssa_partition (map, var1, false);
register_ssa_partition (map, var2, true);
fprintf (debug, "(P%d)", p2);
}
-#ifdef ENABLE_CHECKING
- if (p1 == NO_PARTITION || p2 == NO_PARTITION)
- abort ();
-#endif
+ gcc_assert (p1 != NO_PARTITION);
+ gcc_assert (p2 != NO_PARTITION);
root1 = SSA_NAME_VAR (partition_to_var (map, p1));
root2 = SSA_NAME_VAR (partition_to_var (map, p2));
{
if (bb == ENTRY_BLOCK_PTR)
return;
- if (bb == EXIT_BLOCK_PTR)
- abort ();
+ gcc_assert (bb != EXIT_BLOCK_PTR);
bitmap_set_bit (control_dependence_map[bb->index], edge_index);
}
basic_block current_block;
basic_block ending_block;
-#ifdef ENABLE_CHECKING
- if (INDEX_EDGE_PRED_BB (el, edge_index) == EXIT_BLOCK_PTR)
- abort ();
-#endif
+ gcc_assert (INDEX_EDGE_PRED_BB (el, edge_index) != EXIT_BLOCK_PTR);
if (INDEX_EDGE_PRED_BB (el, edge_index) == ENTRY_BLOCK_PTR)
ending_block = ENTRY_BLOCK_PTR->next_bb;
static inline basic_block
find_pdom (basic_block block)
{
- if (block == ENTRY_BLOCK_PTR)
- abort ();
- else if (block == EXIT_BLOCK_PTR)
+ gcc_assert (block != ENTRY_BLOCK_PTR);
+
+ if (block == EXIT_BLOCK_PTR)
return EXIT_BLOCK_PTR;
else
{
static inline void
mark_stmt_necessary (tree stmt, bool add_to_worklist)
{
-#ifdef ENABLE_CHECKING
- if (stmt == NULL
- || stmt == error_mark_node
- || (stmt && DECL_P (stmt)))
- abort ();
-#endif
+ gcc_assert (stmt);
+ gcc_assert (stmt != error_mark_node);
+ gcc_assert (!DECL_P (stmt));
if (NECESSARY (stmt))
return;
tree stmt;
int ver;
-#ifdef ENABLE_CHECKING
- if (op == NULL)
- abort ();
-#endif
+ gcc_assert (op);
ver = SSA_NAME_VERSION (op);
if (TEST_BIT (processed, ver))
SET_BIT (processed, ver);
stmt = SSA_NAME_DEF_STMT (op);
-#ifdef ENABLE_CHECKING
- if (stmt == NULL)
- abort ();
-#endif
+ gcc_assert (stmt);
if (NECESSARY (stmt)
|| IS_EMPTY_STMT (stmt))
{
tree lhs;
-#if defined ENABLE_CHECKING
- if (TREE_CODE (stmt) != MODIFY_EXPR)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (stmt) == MODIFY_EXPR);
/* Note that we must not check the individual virtual operands
here. In particular, if this is an aliased store, we could
}
}
else
- abort ();
+ gcc_unreachable ();
}
return;
{
int edge_number;
-#ifdef ENABLE_CHECKING
- if (bb == EXIT_BLOCK_PTR)
- abort ();
-#endif
+ gcc_assert (bb != EXIT_BLOCK_PTR);
if (bb == ENTRY_BLOCK_PTR)
return;
{
basic_block post_dom_bb;
edge e;
-#ifdef ENABLE_CHECKING
/* The post dominance info has to be up-to-date. */
- if (dom_computed[CDI_POST_DOMINATORS] != DOM_OK)
- abort ();
-#endif
+ gcc_assert (dom_computed[CDI_POST_DOMINATORS] == DOM_OK);
/* Get the immediate post dominator of bb. */
post_dom_bb = get_immediate_dominator (CDI_POST_DOMINATORS, bb);
/* Some blocks don't have an immediate post dominator. This can happen
basic_block bb ATTRIBUTE_UNUSED,
bool recycled ATTRIBUTE_UNUSED)
{
-#ifdef ENABLE_CHECKING
struct dom_walk_block_data *bd
= (struct dom_walk_block_data *)VARRAY_TOP_GENERIC_PTR (walk_data->block_data_stack);
make sure we clear them before using them! */
if (recycled)
{
- if (bd->avail_exprs && VARRAY_ACTIVE_SIZE (bd->avail_exprs) > 0)
- abort ();
- if (bd->const_and_copies && VARRAY_ACTIVE_SIZE (bd->const_and_copies) > 0)
- abort ();
- if (bd->nonzero_vars && VARRAY_ACTIVE_SIZE (bd->nonzero_vars) > 0)
- abort ();
- if (bd->stmts_to_rescan && VARRAY_ACTIVE_SIZE (bd->stmts_to_rescan) > 0)
- abort ();
- if (bd->vrp_variables && VARRAY_ACTIVE_SIZE (bd->vrp_variables) > 0)
- abort ();
- if (bd->block_defs && VARRAY_ACTIVE_SIZE (bd->block_defs) > 0)
- abort ();
+ gcc_assert (!bd->avail_exprs
+ || VARRAY_ACTIVE_SIZE (bd->avail_exprs) == 0);
+ gcc_assert (!bd->const_and_copies
+ || VARRAY_ACTIVE_SIZE (bd->const_and_copies) == 0);
+ gcc_assert (!bd->nonzero_vars
+ || VARRAY_ACTIVE_SIZE (bd->nonzero_vars) == 0);
+ gcc_assert (!bd->stmts_to_rescan
+ || VARRAY_ACTIVE_SIZE (bd->stmts_to_rescan) == 0);
+ gcc_assert (!bd->vrp_variables
+ || VARRAY_ACTIVE_SIZE (bd->vrp_variables) == 0);
+ gcc_assert (!bd->block_defs
+ || VARRAY_ACTIVE_SIZE (bd->block_defs) == 0);
}
-#endif
}
/* Initialize local stacks for this optimizer and record equivalences
#ifdef ENABLE_CHECKING
/* ??? Why was Jeff testing this? We are gimple... */
- if (!is_gimple_val (def))
- abort ();
+ gcc_assert (is_gimple_val (def));
#endif
to = TREE_TYPE (cond);
hint = i;
}
-#ifdef ENABLE_CHECKING
/* If we did not find the proper alternative, then something is
horribly wrong. */
- if (hint == phi_num_args)
- abort ();
-#endif
+ gcc_assert (hint != phi_num_args);
/* The alternative may be associated with a constant, so verify
it is an SSA_NAME before doing anything with it. */
opt_stats.num_re++;
#if defined ENABLE_CHECKING
- if (TREE_CODE (cached_lhs) != SSA_NAME
- && !is_gimple_min_invariant (cached_lhs))
- abort ();
+ gcc_assert (TREE_CODE (cached_lhs) == SSA_NAME
+ || is_gimple_min_invariant (cached_lhs));
#endif
if (TREE_CODE (cached_lhs) == ADDR_EXPR
if (VUSE_OP (ops1, i) != VUSE_OP (ops2, i))
return false;
-#ifdef ENABLE_CHECKING
- if (((struct expr_hash_elt *)p1)->hash
- != ((struct expr_hash_elt *)p2)->hash)
- abort ();
-#endif
+ gcc_assert (((struct expr_hash_elt *)p1)->hash
+ == ((struct expr_hash_elt *)p2)->hash);
return true;
}
}
}
-#ifdef ENABLE_CHECKING
/* If we did not find a corresponding V_MAY_DEF_RESULT, then something
has gone terribly wrong. */
- if (j == NUM_V_MAY_DEFS (v_may_defs2))
- abort ();
-#endif
-
+ gcc_assert (j != NUM_V_MAY_DEFS (v_may_defs2));
}
}
#include "hashtab.h"
#include "tree-dump.h"
#include "tree-ssa-live.h"
+#include "errors.h"
static void live_worklist (tree_live_info_p, varray_type, int);
static tree_live_info_p new_tree_live_info (var_map);
other_var = var2;
}
- if (p1 == NO_PARTITION || p2 == NO_PARTITION)
- abort ();
+ gcc_assert (p1 != NO_PARTITION);
+ gcc_assert (p2 != NO_PARTITION);
if (p1 == p2)
p3 = p1;
{
var_ann_t ann;
- if (TREE_CODE (var) == SSA_NAME)
- abort();
+ gcc_assert (TREE_CODE (var) != SSA_NAME);
ann = var_ann (var);
ann->out_of_ssa_tag = 1;
EXECUTE_IF_SET_IN_SBITMAP (both, 0, i,
fprintf (stderr, "Variable %s used in real and virtual operands\n",
get_name (referenced_var (i))));
- abort ();
+ internal_error ("SSA corruption");
}
sbitmap_free (used_in_real_ops);
}
}
}
- if (num > 0)
- abort ();
+ gcc_assert (num <= 0);
#endif
BITMAP_XFREE (saw_def);
p = var_to_partition (map, t);
-#ifdef ENABLE_CHECKING
- if (p == NO_PARTITION)
- abort ();
-#endif
+ gcc_assert (p != NO_PARTITION);
/* Make sure we only put coalesced partitions into the list once. */
if (TEST_BIT (seen, p))
p = var_to_partition (map, t);
-#ifdef ENABLE_CHECKING
- if (p == NO_PARTITION)
- abort ();
-#endif
+ gcc_assert (p != NO_PARTITION);
/* If partitions have been coalesced, only add the representative
for the partition to the list once. */
{
partition_pair_p node;
-#ifdef ENABLE_CHECKING
- if (!cl->add_mode)
- abort();
-#endif
+ gcc_assert (cl->add_mode);
if (p1 == p2)
return;
partition_pair_p chain, p;
partition_pair_p *list;
- if (!cl->add_mode)
- abort();
+ gcc_assert (cl->add_mode);
cl->add_mode = false;
for (p = chain; p != NULL; p = p->next)
list[count++] = p;
-#ifdef ENABLE_CHECKING
- if (count != num)
- abort ();
-#endif
+ gcc_assert (count == num);
qsort (list, count, sizeof (partition_pair_p), compare_pairs);
partition_pair_p node;
int ret;
- if (cl->add_mode)
- abort();
+ gcc_assert (!cl->add_mode);
node = cl->list[0];
if (!node)
}
}
}
+
+#ifdef ENABLE_CHECKING
+void
+register_ssa_partition_check (tree ssa_var)
+{
+ gcc_assert (TREE_CODE (ssa_var) == SSA_NAME);
+ if (!is_gimple_reg (SSA_NAME_VAR (ssa_var)))
+ {
+ fprintf (stderr, "Illegally registering a virtual SSA name :");
+ print_generic_expr (stderr, ssa_var, TDF_SLIM);
+ fprintf (stderr, " in the SSA->Normal phase.\n");
+ internal_error ("SSA corruption");
+ }
+}
+#endif
extern void change_partition_var (var_map, tree, int);
extern void compact_var_map (var_map, int);
extern tree make_ssa_temp (tree);
+#ifdef ENABLE_CHECKING
+extern void register_ssa_partition_check (tree ssa_var);
+#endif
static inline int num_var_partitions (var_map);
static inline tree var_to_partition_to_var (var_map, tree);
#define SSA_VAR_MAP_REF_COUNT 0x01
extern var_map create_ssa_var_map (int);
-
/* Number of partitions in MAP. */
static inline int
version_ref_count (var_map map, tree ssa_var)
{
int version = SSA_NAME_VERSION (ssa_var);
-#ifdef ENABLE_CHECKING
- if (!map->ref_count)
- abort ();
-#endif
+ gcc_assert (map->ref_count);
return map->ref_count[version];
}
int version;
#if defined ENABLE_CHECKING
- if (TREE_CODE (ssa_var) != SSA_NAME)
- abort ();
-
- if (!is_gimple_reg (SSA_NAME_VAR (ssa_var)))
- {
- fprintf (stderr, "Illegally registering a virtual SSA name :");
- print_generic_expr (stderr, ssa_var, TDF_SLIM);
- fprintf (stderr, " in the SSA->Normal phase.\n");
- abort();
- }
+ register_ssa_partition_check (ssa_var);
#endif
version = SSA_NAME_VERSION (ssa_var);
static inline int
partition_is_global (tree_live_info_p live, int p)
{
- if (!live->global)
- abort ();
-
+ gcc_assert (live->global);
return bitmap_bit_p (live->global, p);
}
static inline bitmap
live_entry_blocks (tree_live_info_p live, int p)
{
- if (!live->livein)
- abort ();
-
+ gcc_assert (live->livein);
return live->livein[p];
}
static inline bitmap
live_on_exit (tree_live_info_p live, basic_block bb)
{
- if (!live->liveout)
- abort();
+ gcc_assert (live->liveout);
+ gcc_assert (bb != ENTRY_BLOCK_PTR);
+ gcc_assert (bb != EXIT_BLOCK_PTR);
- if (bb == ENTRY_BLOCK_PTR || bb == EXIT_BLOCK_PTR)
- abort ();
-
return live->liveout[bb->index];
}
a compressed element, so return TPA_NONE. */
if (index != TPA_NONE && index >= tpa_num_trees (tpa))
{
-#ifdef ENABLE_CHECKING
- if (tpa->uncompressed_num == -1)
- abort ();
-#endif
+ gcc_assert (tpa->uncompressed_num != -1);
index = TPA_NONE;
}
static inline void
tpa_decompact(tpa_p tpa)
{
-#ifdef ENABLE_CHECKING
- if (tpa->uncompressed_num == -1)
- abort ();
-#endif
+ gcc_assert (tpa->uncompressed_num != -1);
tpa->num_trees = tpa->uncompressed_num;
}
if (header->aux)
return false;
- if (!header->succ)
- abort ();
+ gcc_assert (header->succ);
if (!header->succ->succ_next)
return false;
if (header->succ->succ_next->succ_next)
preheader_edge = VARRAY_GENERIC_PTR_NOGC (bbs_to_duplicate, i);
header = preheader_edge->dest;
- if (!header->aux)
- abort ();
+ gcc_assert (header->aux);
header->aux = NULL;
new_header = duplicate_block (header, preheader_edge);
return true;
default:
- abort ();
+ gcc_unreachable ();
}
}
}
if (flow_loop_nested_p (stmt_loop, level))
return;
- if (!LIM_DATA (stmt))
- abort ();
-
- if (level != LIM_DATA (stmt)->max_loop
- && !flow_loop_nested_p (LIM_DATA (stmt)->max_loop, level))
- abort ();
+ gcc_assert (LIM_DATA (stmt));
+ gcc_assert (level == LIM_DATA (stmt)->max_loop
+ || flow_loop_nested_p (LIM_DATA (stmt)->max_loop, level));
LIM_DATA (stmt)->tgt_loop = level;
for (dep = LIM_DATA (stmt)->depends; dep; dep = dep->next)
return false;
}
- abort ();
+ gcc_unreachable ();
}
/* Determine whether all memory references inside LOOP corresponding to the
break;
default:
- abort ();
+ gcc_unreachable ();
}
fprintf (file, " in statement ");
val = (a * inv) & mask;
- if (((val * b) & mask) != a)
- abort ();
+ gcc_assert (((val * b) & mask) == a);
if ((val >> (bits - 1)) & 1)
val |= ~mask;
{
basic_block bb = ip_normal_pos (loop), sbb = bb_for_stmt (stmt);
- if (!bb)
- abort ();
+ gcc_assert (bb);
if (sbb == loop->latch)
return true;
return stmt_after_ip_original_pos (cand, stmt);
default:
- abort ();
+ gcc_unreachable ();
}
}
{
struct version_info *info = name_info (data, iv);
- if (info->iv)
- abort ();
+ gcc_assert (!info->iv);
bitmap_set_bit (data->relevant, SSA_NAME_VERSION (iv));
info->iv = alloc_iv (base, step);
break;
default:
- abort ();
+ gcc_unreachable ();
}
return false;
{
use = iv_use (data, iv->use_id);
- if (use->type != USE_NONLINEAR_EXPR
- && use->type != USE_OUTER)
- abort ();
+ gcc_assert (use->type == USE_NONLINEAR_EXPR
+ || use->type == USE_OUTER);
if (type == USE_NONLINEAR_EXPR)
use->type = USE_NONLINEAR_EXPR;
*civ = *iv;
stmt = SSA_NAME_DEF_STMT (op);
- if (TREE_CODE (stmt) != PHI_NODE
- && TREE_CODE (stmt) != MODIFY_EXPR)
- abort ();
+ gcc_assert (TREE_CODE (stmt) == PHI_NODE
+ || TREE_CODE (stmt) == MODIFY_EXPR);
use = record_use (data, NULL, civ, stmt, type);
iv->use_id = use->id;
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
}
off = DECL_FIELD_BIT_OFFSET (TREE_OPERAND (addr, 1));
bit_offset = TREE_INT_CST_LOW (off);
- if (bit_offset % BITS_PER_UNIT)
- abort ();
+ gcc_assert ((bit_offset % BITS_PER_UNIT) == 0);
if (diff)
*diff += bit_offset / BITS_PER_UNIT;
return TREE_OPERAND (addr, 0);
default:
- abort ();
+ gcc_unreachable ();
}
}
unsigned HOST_WIDE_INT diff = 0;
unsigned cost;
- if (TREE_CODE (e1) != ADDR_EXPR)
- abort ();
+ gcc_assert (TREE_CODE (e1) == ADDR_EXPR);
if (TREE_CODE (e2) == ADDR_EXPR
&& ptr_difference_const (TREE_OPERAND (e1, 0),
if (!exit)
return false;
- if (!dominated_by_p (CDI_DOMINATORS, exit->src,
- bb_for_stmt (use->stmt)))
- abort ();
+ gcc_assert (dominated_by_p (CDI_DOMINATORS, exit->src,
+ bb_for_stmt (use->stmt)));
niter = &loop_data (loop)->niter;
if (!niter->niter
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
tree op, stmts, tgt, ass;
block_stmt_iterator bsi, pbsi;
- if (TREE_CODE (use->stmt) == PHI_NODE)
+ switch (TREE_CODE (use->stmt))
{
+ case PHI_NODE:
tgt = PHI_RESULT (use->stmt);
/* If we should keep the biv, do not replace it. */
bsi = pbsi;
bsi_next (&pbsi);
}
- }
- else if (TREE_CODE (use->stmt) == MODIFY_EXPR)
- {
+ break;
+
+ case MODIFY_EXPR:
tgt = TREE_OPERAND (use->stmt, 0);
bsi = stmt_for_bsi (use->stmt);
+ break;
+
+ default:
+ gcc_unreachable ();
}
- else
- abort ();
op = force_gimple_operand (comp, &stmts, false, SSA_NAME_VAR (tgt));
tree value, op, stmts, tgt;
tree phi;
- if (TREE_CODE (use->stmt) == PHI_NODE)
- tgt = PHI_RESULT (use->stmt);
- else if (TREE_CODE (use->stmt) == MODIFY_EXPR)
- tgt = TREE_OPERAND (use->stmt, 0);
- else
- abort ();
+ switch (TREE_CODE (use->stmt))
+ {
+ case PHI_NODE:
+ tgt = PHI_RESULT (use->stmt);
+ break;
+ case MODIFY_EXPR:
+ tgt = TREE_OPERAND (use->stmt, 0);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
exit = single_dom_exit (data->current_loop);
if (exit)
{
if (!cand->iv)
{
- if (!may_replace_final_value (data->current_loop, use, &value))
- abort ();
+ bool ok = may_replace_final_value (data->current_loop, use, &value);
+ gcc_assert (ok);
}
else
value = get_computation_at (data->current_loop,
break;
default:
- abort ();
+ gcc_unreachable ();
}
modify_stmt (use->stmt);
}
{
use = iv_use (data, i);
cand = use->selected;
- if (!cand)
- abort ();
+ gcc_assert (cand);
rewrite_use (data, use, cand);
}
unsigned i;
bitmap names_to_rename;
- if (any_marked_for_rewrite_p ())
- abort ();
+ gcc_assert (!any_marked_for_rewrite_p ());
use_blocks = xcalloc (num_ssa_names, sizeof (bitmap));
def = SSA_NAME_DEF_STMT (use);
def_bb = bb_for_stmt (def);
- if (def_bb
- && !flow_bb_inside_loop_p (def_bb->loop_father, bb))
- abort ();
+ gcc_assert (!def_bb
+ || flow_bb_inside_loop_p (def_bb->loop_father, bb));
}
/* Checks invariants of loop closed ssa form in statement STMT in BB. */
#include "flags.h"
#include "function.h"
#include "diagnostic.h"
+#include "errors.h"
#include "tree-flow.h"
#include "tree-inline.h"
#include "tree-pass.h"
if (num == 0)
return NULL;
-#ifdef ENABLE_CHECKING
/* There should only be a single real definition per assignment. */
- if (TREE_CODE (stmt) == MODIFY_EXPR && num > 1)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (stmt) != MODIFY_EXPR || num <= 1);
old_ops = *old_ops_p;
initial call to get_stmt_operands does not pass a pointer to a
statement). */
for (x = 0; x < num; x++)
- if (*(VARRAY_TREE_PTR (build_uses, x)) == stmt)
- abort ();
+ gcc_assert (*(VARRAY_TREE_PTR (build_uses, x)) != stmt);
}
#endif
old_ops = *old_ops_p;
if (num == 0)
return NULL;
-#ifdef ENABLE_CHECKING
/* There should only be a single V_MUST_DEF per assignment. */
- if (TREE_CODE (stmt) == MODIFY_EXPR && num > 1)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (stmt) != MODIFY_EXPR || num <= 1);
old_ops = *old_ops_p;
static inline void
start_ssa_stmt_operands (void)
{
-#ifdef ENABLE_CHECKING
- if (VARRAY_ACTIVE_SIZE (build_defs) > 0
- || VARRAY_ACTIVE_SIZE (build_uses) > 0
- || VARRAY_ACTIVE_SIZE (build_vuses) > 0
- || VARRAY_ACTIVE_SIZE (build_v_may_defs) > 0
- || VARRAY_ACTIVE_SIZE (build_v_must_defs) > 0)
- abort ();
-#endif
+ gcc_assert (VARRAY_ACTIVE_SIZE (build_defs) == 0);
+ gcc_assert (VARRAY_ACTIVE_SIZE (build_uses) == 0);
+ gcc_assert (VARRAY_ACTIVE_SIZE (build_vuses) == 0);
+ gcc_assert (VARRAY_ACTIVE_SIZE (build_v_may_defs) == 0);
+ gcc_assert (VARRAY_ACTIVE_SIZE (build_v_must_defs) == 0);
}
stmt_ann_t ann;
stmt_operands_t old_operands;
-#if defined ENABLE_CHECKING
/* The optimizers cannot handle statements that are nothing but a
_DECL. This indicates a bug in the gimplifier. */
- if (SSA_VAR_P (stmt))
- abort ();
-#endif
+ gcc_assert (!SSA_VAR_P (stmt));
/* Ignore error statements. */
if (TREE_CODE (stmt) == ERROR_MARK)
}
/* If we get here, something has gone wrong. */
+#ifdef ENABLE_CHECKING
fprintf (stderr, "unhandled expression in get_expr_operands():\n");
debug_tree (expr);
fputs ("\n", stderr);
- abort ();
+ internal_error ("internal error");
+#endif
+ gcc_unreachable ();
}
parse_output_constraint (&constraint, i, 0, 0,
&allows_mem, &allows_reg, &is_inout);
-#if defined ENABLE_CHECKING
/* This should have been split in gimplify_asm_expr. */
- if (allows_reg && is_inout)
- abort ();
-#endif
+ gcc_assert (!allows_reg || !is_inout);
/* Memory operands are addressable. Note that STMT needs the
address of this operand. */
/* Ok, this isn't even is_gimple_min_invariant. Something's broke. */
else
- abort ();
+ gcc_unreachable ();
/* Add a USE operand for the base pointer. */
get_expr_operands (stmt, pptr, opf_none);
{
if (flags & opf_kill_def)
{
-#if defined ENABLE_CHECKING
/* Only regular variables may get a V_MUST_DEF
operand. */
- if (v_ann->mem_tag_kind != NOT_A_TAG)
- abort ();
-#endif
+ gcc_assert (v_ann->mem_tag_kind == NOT_A_TAG);
/* V_MUST_DEF for non-aliased, non-GIMPLE register
variable definitions. */
append_v_must_def (var);
/* The variable is aliased. Add its aliases to the virtual
operands. */
-#if defined ENABLE_CHECKING
- if (VARRAY_ACTIVE_SIZE (aliases) == 0)
- abort ();
-#endif
+ gcc_assert (VARRAY_ACTIVE_SIZE (aliases) != 0);
if (flags & opf_is_def)
{
static void
value_remove_from_set_bitmap (value_set_t set, tree v)
{
-#ifdef ENABLE_CHECKING
- if (!set->indexed)
- abort ();
-#endif
+ gcc_assert (set->indexed);
if (!set->values)
return;
static inline void
value_insert_into_set_bitmap (value_set_t set, tree v)
{
-#ifdef ENABLE_CHECKING
- if (!set->indexed)
- abort ();
-#endif
+ gcc_assert (set->indexed);
if (set->values == NULL)
{
{
tree val;
/* XXX: For now, we only let SSA_NAMES into the bitmap sets. */
- if (TREE_CODE (expr) != SSA_NAME)
- abort ();
+ gcc_assert (TREE_CODE (expr) == SSA_NAME);
val = get_value_handle (expr);
- if (val == NULL)
- abort ();
+ gcc_assert (val);
if (!is_gimple_min_invariant (val))
bitmap_set_bit (set->values, VALUE_HANDLE_ID (val));
bitmap_set_bit (set->expressions, SSA_NAME_VERSION (expr));
{
value_set_node_t newnode = pool_alloc (value_set_node_pool);
tree val = get_value_handle (expr);
-
- if (val == NULL)
- abort ();
+ gcc_assert (val);
/* For indexed sets, insert the value into the set value bitmap.
For all sets, add it to the linked list and increment the list
}
break;
case 'd':
- abort ();
+ gcc_unreachable ();
case 'x':
{
tree phi = NULL;
int i;
- if (TREE_CODE (expr) != SSA_NAME)
- abort ();
+ gcc_assert (TREE_CODE (expr) == SSA_NAME);
if (TREE_CODE (SSA_NAME_DEF_STMT (expr)) == PHI_NODE)
phi = SSA_NAME_DEF_STMT (expr);
else
}
case 'x':
{
- if (TREE_CODE (expr) == SSA_NAME)
- return true;
- abort ();
+ gcc_assert (TREE_CODE (expr) == SSA_NAME);
+ return true;
}
case 'c':
- abort ();
+ gcc_unreachable ();
}
return false;
}
FOR_ALL_BB (bb)
{
ANTIC_IN (bb) = set_new (true);
- if (bb->flags & BB_VISITED)
- abort ();
+ gcc_assert (!(bb->flags & BB_VISITED));
}
while (changed)
if (genop == NULL)
{
genop = VALUE_HANDLE_EXPR_SET (expr)->head->expr;
- if (TREE_CODE_CLASS (TREE_CODE (genop)) != '1'
- && TREE_CODE_CLASS (TREE_CODE (genop)) != '2'
- && TREE_CODE_CLASS (TREE_CODE (genop)) != 'r')
- abort ();
+ gcc_assert (TREE_CODE_CLASS (TREE_CODE (genop)) == '1'
+ || TREE_CODE_CLASS (TREE_CODE (genop)) == '2'
+ || TREE_CODE_CLASS (TREE_CODE (genop)) == 'r');
genop = create_expression_by_pieces (block, genop, stmts);
}
return genop;
break;
}
default:
- abort ();
+ gcc_unreachable ();
}
v = get_value_handle (expr);
}
vprime = get_value_handle (eprime);
- if (!vprime)
- abort ();
+ gcc_assert (vprime);
edoubleprime = bitmap_find_leader (AVAIL_OUT (bprime),
vprime);
if (edoubleprime == NULL)
first_s = edoubleprime;
else if (first_s != edoubleprime)
all_same = false;
- if (first_s != edoubleprime
- && operand_equal_p (first_s, edoubleprime, 0))
- abort ();
+ gcc_assert (first_s == edoubleprime
+ || !operand_equal_p
+ (first_s, edoubleprime, 0));
}
}
/* If we can insert it, it's not the same value
enum tree_code code = TREE_CODE (expr);
tree vexpr;
-#if defined ENABLE_CHECKING
- if (TREE_CODE_CLASS (code) != '1'
- && TREE_CODE_CLASS (code) != '2'
- && TREE_CODE_CLASS (code) != 'r')
- abort ();
-#endif
+ gcc_assert (TREE_CODE_CLASS (code) == '1'
+ || TREE_CODE_CLASS (code) == '2'
+ || TREE_CODE_CLASS (code) == 'r');
if (TREE_CODE_CLASS (code) == '1')
vexpr = pool_alloc (unary_node_pool);
&& (TREE_CODE (*rhs_p) != SSA_NAME
|| may_propagate_copy (*rhs_p, sprime)))
{
- if (sprime == *rhs_p)
- abort ();
+ gcc_assert (sprime != *rhs_p);
if (dump_file && (dump_flags & TDF_DETAILS))
{
bb = VARRAY_BB (cfg_blocks, cfg_blocks_head);
-#ifdef ENABLE_CHECKING
- if (cfg_blocks_empty_p () || !bb)
- abort ();
-#endif
+ gcc_assert (!cfg_blocks_empty_p ());
+ gcc_assert (bb);
cfg_blocks_head = (cfg_blocks_head + 1) % VARRAY_SIZE (cfg_blocks);
--cfg_blocks_num;
bsi = bsi_last (bb);
-#ifdef ENABLE_CHECKING
- if (TREE_CODE (bsi_stmt (bsi)) != COND_EXPR
- && TREE_CODE (bsi_stmt (bsi)) != SWITCH_EXPR)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (bsi_stmt (bsi)) == COND_EXPR
+ || TREE_CODE (bsi_stmt (bsi)) == SWITCH_EXPR);
bsi_remove (&bsi);
{
tree def_stmt;
-#if defined ENABLE_CHECKING
- if (TREE_CODE (var) != SSA_NAME)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (var) == SSA_NAME);
def_stmt = SSA_NAME_DEF_STMT (var);
/* At least one of the arguments should not be equal to the result, or
something strange is happening. */
- if (!val)
- abort ();
+ gcc_assert (val);
if (get_eq_name (eq_to, res) == val)
return;
{
tree t;
-#if defined ENABLE_CHECKING
- if ((!DECL_P (var)
- && TREE_CODE (var) != INDIRECT_REF)
- || (stmt
- && !IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (stmt)))
- && TREE_CODE (stmt) != PHI_NODE))
- abort ();
-#endif
+ gcc_assert (DECL_P (var)
+ || TREE_CODE (var) == INDIRECT_REF);
+
+ gcc_assert (!stmt
+ || IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (stmt)))
+ || TREE_CODE (stmt) == PHI_NODE);
/* If our free list has an element, then use it. Also reuse the
SSA version number of the element on the free list which helps
for (e = bb->pred; e; e = e->pred_next)
if (e->src->aux)
break;
- if (!e)
- abort ();
+ gcc_assert (e);
expr = PHI_ARG_DEF_FROM_EDGE (at, e);
if (TREE_CODE (expr) != SSA_NAME)
tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
block_stmt_iterator bsi = bsi_last (bb);
- if (TREE_CODE (ret_stmt) != RETURN_EXPR)
- abort ();
+ gcc_assert (TREE_CODE (ret_stmt) == RETURN_EXPR);
ret_var = TREE_OPERAND (ret_stmt, 0);
if (!ret_var)
/* Replace the call by a jump to the start of function. */
e = redirect_edge_and_branch (t->call_block->succ, first);
- if (!e)
- abort ();
+ gcc_assert (e);
PENDING_STMT (e) = NULL_TREE;
/* Add phi node entries for arguments. Not every PHI node corresponds to
/* For all calls the same set of variables should be clobbered. This
means that there always should be the appropriate phi node except
for the first time we eliminate the call. */
- if (first->pred->pred_next->pred_next)
- abort ();
+ gcc_assert (!first->pred->pred_next->pred_next);
}
add_phi_arg (&phi, V_MAY_DEF_OP (v_may_defs, i), e);
varray_type access_fns = DR_ACCESS_FNS (dr);
/* FORNOW: handling only one dimensional arrays. */
- if (VARRAY_ACTIVE_SIZE (access_fns) != 1)
- abort ();
-
- if (!vectorization_factor)
- abort ();
+ gcc_assert (VARRAY_ACTIVE_SIZE (access_fns) == 1);
+ gcc_assert (vectorization_factor);
#endif
access_fn = DR_ACCESS_FN (dr, 0);
ok = vect_is_simple_iv_evolution (loopnum, access_fn, &init, &step, true)
&& vect_get_first_index (expr, &array_first_index);
-#ifdef ENABLE_CHECKING
- if (!ok)
- abort ();
+ gcc_assert (ok);
/* FORNOW: Handling only constant 'init'. */
- if (TREE_CODE (init) != INTEGER_CST)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (init) == INTEGER_CST);
vf = build_int_cst (unsigned_type_node, vectorization_factor);
/* FORNOW: can't handle misaligned accesses;
all accesses expected to be aligned. */
- if (!aligned_access_p (dr))
- abort ();
+ gcc_assert (aligned_access_p (dr));
}
get_name (addr_ref));
add_referenced_tmp_var (vect_ptr);
-#ifdef ENABLE_CHECKING
- if (TREE_CODE (addr_ref) != VAR_DECL
- && TREE_CODE (addr_ref) != COMPONENT_REF
- && TREE_CODE (addr_ref) != SSA_NAME)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (addr_ref) == VAR_DECL
+ || TREE_CODE (addr_ref) == COMPONENT_REF
+ || TREE_CODE (addr_ref) == SSA_NAME);
if (vect_debug_details (NULL))
{
/* Handle aliasing: */
tag = STMT_VINFO_MEMTAG (stmt_info);
-#ifdef ENABLE_CHECKING
- if (!tag)
- abort ();
-#endif
+ gcc_assert (tag);
get_var_ann (vect_ptr)->type_mem_tag = tag;
/* Mark for renaming all aliased variables
tree vec_dest;
const char *new_name;
-#ifdef ENABLE_CHECKING
- if (TREE_CODE (scalar_dest) != SSA_NAME)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (scalar_dest) == SSA_NAME);
new_name = get_name (scalar_dest);
if (!new_name)
return vect_init_vector (stmt, vec_cst);
}
-#ifdef ENABLE_CHECKING
- if (TREE_CODE (op) != SSA_NAME)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (op) == SSA_NAME);
/** ===> Case 2: operand is an SSA_NAME - find the stmt that defines it. **/
/* Get the def from the vectorized stmt. */
vec_stmt = STMT_VINFO_VEC_STMT (def_stmt_info);
-#ifdef ENABLE_CHECKING
- if (!vec_stmt)
- abort ();
-#endif
+ gcc_assert (vec_stmt);
vec_oprnd = TREE_OPERAND (vec_stmt, 0);
return vec_oprnd;
}
{
if (vect_debug_details (NULL))
fprintf (dump_file, "reduction/induction - unsupported.");
- abort (); /* FORNOW no support for reduction/induction. */
+ internal_error ("no support for reduction/induction"); /* FORNOW */
}
break;
case NOP_EXPR:
def = TREE_OPERAND (def_stmt, 0);
-#ifdef ENABLE_CHECKING
- if (!IS_EMPTY_STMT (def_stmt))
- abort ();
-#endif
+ gcc_assert (IS_EMPTY_STMT (def_stmt));
def = op;
break;
default:
fprintf (dump_file, "unsupported defining stmt: ");
print_generic_expr (dump_file, def_stmt, TDF_SLIM);
}
- abort ();
+ internal_error ("unsupported defining stmt");
}
/* Build a tree with vector elements. Create 'vec_inv = {inv,inv,..,inv}' */
while (stmt != bsi_stmt (*bsi) && !bsi_end_p (*bsi))
bsi_next (bsi);
-#ifdef ENABLE_CHECKING
- if (stmt != bsi_stmt (*bsi))
- abort ();
-#endif
+ gcc_assert (stmt == bsi_stmt (*bsi));
}
bool is_store = false;
tree vec_stmt = NULL_TREE;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+ bool done;
switch (STMT_VINFO_TYPE (stmt_info))
{
case op_vec_info_type:
- if (!vectorizable_operation (stmt, bsi, &vec_stmt))
- abort ();
+ done = vectorizable_operation (stmt, bsi, &vec_stmt);
+ gcc_assert (done);
break;
case assignment_vec_info_type:
- if (!vectorizable_assignment (stmt, bsi, &vec_stmt))
- abort ();
+ done = vectorizable_assignment (stmt, bsi, &vec_stmt);
+ gcc_assert (done);
break;
case load_vec_info_type:
- if (!vectorizable_load (stmt, bsi, &vec_stmt))
- abort ();
+ done = vectorizable_load (stmt, bsi, &vec_stmt);
+ gcc_assert (done);
break;
case store_vec_info_type:
- if (!vectorizable_store (stmt, bsi, &vec_stmt))
- abort ();
+ done = vectorizable_store (stmt, bsi, &vec_stmt);
+ gcc_assert (done);
is_store = true;
break;
default:
if (vect_debug_details (NULL))
fprintf (dump_file, "stmt not supported.");
- abort ();
+ gcc_unreachable ();
}
STMT_VINFO_VEC_STMT (stmt_info) = vec_stmt;
tree cond;
tree lb_type;
-#ifdef ENABLE_CHECKING
- if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo))
- abort ();
-#endif
+ gcc_assert (LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo));
old_N = LOOP_VINFO_NITERS (loop_vinfo);
vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
-#ifdef ENABLE_CHECKING
/* FORNOW:
assuming number-of-iterations divides by the vectorization factor. */
- if (old_N % vf)
- abort ();
-#endif
+ gcc_assert (!(old_N % vf));
orig_cond_expr = LOOP_VINFO_EXIT_COND (loop_vinfo);
-#ifdef ENABLE_CHECKING
- if (!orig_cond_expr)
- abort ();
-#endif
- if (orig_cond_expr != bsi_stmt (loop_exit_bsi))
- abort ();
+ gcc_assert (orig_cond_expr);
+ gcc_assert (orig_cond_expr == bsi_stmt (loop_exit_bsi));
create_iv (integer_zero_node, integer_one_node, NULL_TREE, loop,
&loop_exit_bsi, false, &indx_before_incr, &indx_after_incr);
/* bsi_insert is using BSI_NEW_STMT. We need to bump it back
to point to the exit condition. */
bsi_next (&loop_exit_bsi);
- if (bsi_stmt (loop_exit_bsi) != orig_cond_expr)
- abort ();
+ gcc_assert (bsi_stmt (loop_exit_bsi) == orig_cond_expr);
/* new loop exit test: */
lb_type = TREE_TYPE (TREE_OPERAND (TREE_OPERAND (orig_cond_expr, 0), 1));
/* 1) Make sure the loop header has exactly two entries
2) Make sure we have a preheader basic block. */
- if (!loop->header->pred->pred_next
- || loop->header->pred->pred_next->pred_next)
- abort ();
+ gcc_assert (loop->header->pred->pred_next);
+ gcc_assert (!loop->header->pred->pred_next->pred_next);
loop_split_edge_with (loop_preheader_edge (loop), NULL);
print_generic_expr (dump_file, stmt, TDF_SLIM);
}
stmt_info = vinfo_for_stmt (stmt);
-#ifdef ENABLE_CHECKING
- if (!stmt_info)
- abort ();
-#endif
+ gcc_assert (stmt_info);
if (!STMT_VINFO_RELEVANT_P (stmt_info))
{
bsi_next (&si);
/* FORNOW: Verify that all stmts operate on the same number of
units and no inner unrolling is necessary. */
vectype = STMT_VINFO_VECTYPE (stmt_info);
- if (GET_MODE_NUNITS (TYPE_MODE (vectype)) != vectorization_factor)
- abort ();
+ gcc_assert (GET_MODE_NUNITS (TYPE_MODE (vectype))
+ == vectorization_factor);
#endif
/* -------- vectorize statement ------------ */
if (vect_debug_details (NULL))
fprintf (dump_file, "==> examining statement: ");
print_generic_expr (dump_file, stmt, TDF_SLIM);
}
-#ifdef ENABLE_CHECKING
- if (!stmt_info)
- abort ();
-#endif
+
+ gcc_assert (stmt_info);
+
/* skip stmts which do not need to be vectorized.
this is expected to include:
- the COND_EXPR which is the loop exit condition
{
size_t i;
-#if defined ENABLE_CHECKING
/* EXPR must not be a statement. We are only interested in value
numbering expressions on the RHS of assignments. */
- if (expr == NULL_TREE
- || (expr->common.ann
- && expr->common.ann->common.type == STMT_ANN))
- abort ();
-#endif
+ gcc_assert (expr);
+ gcc_assert (!expr->common.ann
+ || expr->common.ann->common.type != STMT_ANN);
val = iterative_hash_expr (expr, val);
SSA_NAME_VALUE (e) = v;
else if (EXPR_P (e) || DECL_P (e))
get_tree_ann (e)->common.value_handle = v;
- else if (is_gimple_min_invariant (e))
- /* Do nothing. Constants are their own value handles. */
- ;
else
- abort ();
+ /* Do nothing. Constants are their own value handles. */
+ gcc_assert (is_gimple_min_invariant (e));
}
tree_ann_t ann = tree_ann (expr);
return ((ann) ? ann->common.value_handle : NULL_TREE);
}
- else if (is_gimple_min_invariant (expr))
- return expr;
-
- abort ();
+ else
+ {
+ gcc_assert (is_gimple_min_invariant (expr));
+ return expr;
+ }
}
}
default:
- abort ();
+ gcc_unreachable ();
}
}
/* We can't allocate a TREE_VEC, PHI_NODE, or STRING_CST
without knowing how many elements it will have. */
- if (code == TREE_VEC || code == PHI_NODE)
- abort ();
+ gcc_assert (code != TREE_VEC);
+ gcc_assert (code != PHI_NODE);
TREE_SET_CODE ((tree)&ttmp, code);
length = tree_size ((tree)&ttmp);
break;
default:
- abort ();
+ gcc_unreachable ();
}
tree_node_counts[(int) kind]++;
enum tree_code code = TREE_CODE (node);
size_t length;
-#ifdef ENABLE_CHECKING
- if (code == STATEMENT_LIST)
- abort ();
-#endif
+ gcc_assert (code != STATEMENT_LIST);
length = tree_size (node);
t = ggc_alloc_zone_stat (length, tree_zone PASS_MEM_STAT);
if (t)
{
/* Make sure no one is clobbering the shared constant. */
- if (TREE_TYPE (t) != type)
- abort ();
- if (TREE_INT_CST_LOW (t) != low || TREE_INT_CST_HIGH (t) != hi)
- abort ();
+ gcc_assert (TREE_TYPE (t) == type);
+ gcc_assert (TREE_INT_CST_LOW (t) == low);
+ gcc_assert (TREE_INT_CST_HIGH (t) == hi);
return t;
}
}
shift_amount = prec - HOST_BITS_PER_WIDE_INT;
- if (shift_amount > HOST_BITS_PER_WIDE_INT)
- /* Can not handle precisions greater than twice the host int size. */
- abort ();
- else if (shift_amount == HOST_BITS_PER_WIDE_INT)
+ /* Can not handle precisions greater than twice the host int size. */
+ gcc_assert (shift_amount <= HOST_BITS_PER_WIDE_INT);
+ if (shift_amount == HOST_BITS_PER_WIDE_INT)
/* Shifting by the host word size is undefined according to the ANSI
standard, so we must handle this as a special case. */
high_value = -1;
#ifdef ENABLE_TREE_CHECKING
if (len % 2)
q = TREE_CHAIN (q);
- if (p == q)
- abort ();
+ gcc_assert (p != q);
#endif
len++;
}
{
tree t2;
for (t2 = op2; t2; t2 = TREE_CHAIN (t2))
- if (t2 == t1)
- abort (); /* Circularity created. */
+ gcc_assert (t2 != t1);
}
#endif
case VALUE_HANDLE: return TS_VALUE_HANDLE;
default:
- abort ();
+ gcc_unreachable ();
}
}
\f
}
default:
- abort ();
+ gcc_unreachable ();
}
}
break;
default:
- abort ();
+ gcc_unreachable ();
}
break;
default:
- abort ();
+ gcc_unreachable ();
}
TREE_READONLY (new) = TREE_READONLY (exp);
return fold (build4 (code, TREE_TYPE (exp), op0, op1, op2, op3));
default:
- abort ();
+ gcc_unreachable ();
}
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
\f
break;
default:
- abort ();
+ gcc_unreachable ();
}
TREE_TYPE (result) = TREE_TYPE (e);
{
tree t;
-#ifdef ENABLE_CHECKING
- if (TREE_CODE_LENGTH (code) != 0)
- abort ();
-#endif
+ gcc_assert (TREE_CODE_LENGTH (code) == 0);
t = make_node_stat (code PASS_MEM_STAT);
TREE_TYPE (t) = tt;
tree_node_sizes[(int) kind] += length;
#endif
-#ifdef ENABLE_CHECKING
- if (TREE_CODE_LENGTH (code) != 1)
- abort ();
-#endif /* ENABLE_CHECKING */
+ gcc_assert (TREE_CODE_LENGTH (code) == 1);
t = ggc_alloc_zone_stat (length, tree_zone PASS_MEM_STAT);
tree t;
int fro;
-#ifdef ENABLE_CHECKING
- if (TREE_CODE_LENGTH (code) != 2)
- abort ();
-#endif
+ gcc_assert (TREE_CODE_LENGTH (code) == 2);
t = make_node_stat (code PASS_MEM_STAT);
TREE_TYPE (t) = tt;
tree t;
int fro;
-#ifdef ENABLE_CHECKING
- if (TREE_CODE_LENGTH (code) != 3)
- abort ();
-#endif
+ gcc_assert (TREE_CODE_LENGTH (code) == 3);
t = make_node_stat (code PASS_MEM_STAT);
TREE_TYPE (t) = tt;
tree t;
int fro;
-#ifdef ENABLE_CHECKING
- if (TREE_CODE_LENGTH (code) != 4)
- abort ();
-#endif
+ gcc_assert (TREE_CODE_LENGTH (code) == 4);
t = make_node_stat (code PASS_MEM_STAT);
TREE_TYPE (t) = tt;
t = build4 (code, tt, arg0, arg1, arg2, arg3);
break;
default:
- abort ();
+ gcc_unreachable ();
}
va_end (p);
/* If ATTR is `__text__', IDENT must be `text'; and vice versa. */
if (attr[0] == '_')
{
- if (attr[1] != '_'
- || attr[attr_len - 2] != '_'
- || attr[attr_len - 1] != '_')
- abort ();
+ gcc_assert (attr[1] == '_');
+ gcc_assert (attr[attr_len - 2] == '_');
+ gcc_assert (attr[attr_len - 1] == '_');
+ gcc_assert (attr[1] == '_');
if (ident_len == attr_len - 4
&& strncmp (attr + 2, p, attr_len - 4) == 0)
return 1;
for (l = list; l; l = TREE_CHAIN (l))
{
- if (TREE_CODE (TREE_PURPOSE (l)) != IDENTIFIER_NODE)
- abort ();
+ gcc_assert (TREE_CODE (TREE_PURPOSE (l)) == IDENTIFIER_NODE);
if (is_attribute_p (attr_name, TREE_PURPOSE (l)))
return l;
}
/* The hash table only contains main variants, so ensure that's what we're
being passed. */
- if (TYPE_MAIN_VARIANT (type) != type)
- abort ();
+ gcc_assert (TYPE_MAIN_VARIANT (type) == type);
if (!lang_hooks.types.hash_types)
return type;
HOST_WIDE_INT
tree_low_cst (tree t, int pos)
{
- if (host_integerp (t, pos))
- return TREE_INT_CST_LOW (t);
- else
- abort ();
+ gcc_assert (host_integerp (t, pos));
+ return TREE_INT_CST_LOW (t);
}
/* Return the most significant bit of the integer constant T. */
val = iterative_hash_expr (TREE_OPERAND (t, i), val);
}
else
- abort ();
+ gcc_unreachable ();
return val;
break;
}
tree
build_method_type (tree basetype, tree type)
{
- if (TREE_CODE (type) != FUNCTION_TYPE)
- abort ();
+ gcc_assert (TREE_CODE (type) == FUNCTION_TYPE);
return build_method_type_directly (basetype,
TREE_TYPE (type),
break;
default:
- abort ();
+ gcc_unreachable ();
}
return NULL_TREE;
/* It's invalid to call this function with anything but a
CALL_EXPR. */
- if (TREE_CODE (call) != CALL_EXPR)
- abort ();
+ gcc_assert (TREE_CODE (call) == CALL_EXPR);
/* The first operand to the CALL is the address of the function
called. */
HOST_WIDE_INT hi_index
= tree_low_cst (TREE_VALUE (vals), 0) - domain_min;
- if (lo_index < 0 || lo_index >= bit_size
- || hi_index < 0 || hi_index >= bit_size)
- abort ();
+ gcc_assert (lo_index >= 0);
+ gcc_assert (lo_index < bit_size);
+ gcc_assert (hi_index >= 0);
+ gcc_assert (hi_index < bit_size);
for (; lo_index <= hi_index; lo_index++)
buffer[lo_index] = 1;
}
{
int nunits;
- if (GET_MODE_CLASS (mode) == MODE_VECTOR_INT
- || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)
- nunits = GET_MODE_NUNITS (mode);
-
- else if (GET_MODE_CLASS (mode) == MODE_INT)
+ switch (GET_MODE_CLASS (mode))
{
+ case MODE_VECTOR_INT:
+ case MODE_VECTOR_FLOAT:
+ nunits = GET_MODE_NUNITS (mode);
+ break;
+
+ case MODE_INT:
/* Check that there are no leftover bits. */
- if (GET_MODE_BITSIZE (mode) % TREE_INT_CST_LOW (TYPE_SIZE (innertype)))
- abort ();
+ gcc_assert (GET_MODE_BITSIZE (mode)
+ % TREE_INT_CST_LOW (TYPE_SIZE (innertype)) == 0);
nunits = GET_MODE_BITSIZE (mode)
/ TREE_INT_CST_LOW (TYPE_SIZE (innertype));
+ break;
+
+ default:
+ gcc_unreachable ();
}
- else
- abort ();
return make_vector_type (innertype, nunits, mode);
}
unsigned HOST_WIDE_INT val = TREE_INT_CST_LOW (x);
bool negative = ((val >> (bits - 1)) & 1) != 0;
- if (bits > HOST_BITS_PER_WIDE_INT)
- abort ();
+ gcc_assert (bits <= HOST_BITS_PER_WIDE_INT);
if (negative)
val |= (~(unsigned HOST_WIDE_INT) 0) << (bits - 1) << 1;
tree a_mod_b;
tree type = TREE_TYPE (a);
-#if defined ENABLE_CHECKING
- if (TREE_CODE (a) != INTEGER_CST
- || TREE_CODE (b) != INTEGER_CST)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (a) == INTEGER_CST);
+ gcc_assert (TREE_CODE (b) == INTEGER_CST);
if (integer_zerop (a))
return b;