summaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-09 13:54:07 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-09 13:54:07 +0000
commit0d59b19dc2331e2fd6d3ce1d95d0d6c22263c282 (patch)
tree186a20ffec3fade2a9f7714afe4a71cd22d79511 /gcc/gimplify.c
parentd447f9c8dd7ac560eafefb78fdfe0d4479a44d99 (diff)
downloadgcc-0d59b19dc2331e2fd6d3ce1d95d0d6c22263c282.tar.gz
* gcse.c (INSN_CUID, insert_set_in_table, find_avail_set,
cprop_insn, do_local_cprop, local_cprop_pass, find_bypass_set, process_insert_insn, insert_insn_end_bb, pre_insert_copy_insn, hoist_code, extract_mentioned_regs_helper, compute_store_table, insert_store): Use gcc_assert and gcc_unreachable. * ggc-common.c (ggc_splay_alloc, ggc_splay_dont_free, gt_pch_note_object, gt_pch_note_reorder, relocate_ptrs, ggc_record_overhead): Likewise. * ggc-page.c (alloc_page, free_page, ggc_set_mark, ggc_marked_p, init_ggc, ggc_push_context, ggc_recalculate_in_use_p, ggc_pop_context, clear_marks, validate_free_objects, ggc_pch_read): Likewise. * ggc-zone.c (ggc_allocated_p, free_chunk, ggc_set_mark, ggc_marked_p, ggc_get_size, init_ggc, destroy_ggc_zone, ggc_push_context, check_cookies, ggc_collect, ggc_print_statistics): Likewise. * gimple-low.c (lower_function_body, lower_stmt, lower_bind_expr): Likewise. * gimplify.c (gimple_tree_eq, push_gimplify_context, pop_gimplify_context, gimple_pop_condition, create_tmp_var, declare_tmp_vars, gimple_add_tmp_var, annotate_all_with_locus, mostly_copy_tree_r, gimplify_return_expr, gimplify_switch_expr, gimplify_case_label_expr, gimplify_exit_block_expr, canonicalize_component_ref, gimplify_compound_lval, gimplify_self_mod_expr, gimplify_call_expr, gimplify_init_ctor_eval, gimplify_init_constructor, gimplify_modify_expr, gimplify_save_expr, gimplify_target_expr, gimplify_expr, check_pointer_types_r, force_gimple_operand): Likewise. * global.c (global_alloc, build_insn_chain): Likewise. * graph.c (clean_graph_dump_file, finish_graph_dump_file): Likewise. gcov-io.c (gcov_open): Use GCOV_CHECK. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87240 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c300
1 files changed, 130 insertions, 170 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 839b62553b6..c657f6af77a 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -103,8 +103,7 @@ gimple_tree_eq (const void *p1, const void *p2)
/* Only allow them to compare equal if they also hash equal; otherwise
results are nondeterminate, and we fail bootstrap comparison. */
- if (gimple_tree_hash (p1) != gimple_tree_hash (p2))
- abort ();
+ gcc_assert (gimple_tree_hash (p1) == gimple_tree_hash (p2));
return 1;
}
@@ -114,8 +113,7 @@ gimple_tree_eq (const void *p1, const void *p2)
void
push_gimplify_context (void)
{
- if (gimplify_ctxp)
- abort ();
+ gcc_assert (!gimplify_ctxp);
gimplify_ctxp
= (struct gimplify_ctx *) xcalloc (1, sizeof (struct gimplify_ctx));
if (optimize)
@@ -134,8 +132,7 @@ pop_gimplify_context (tree body)
{
tree t;
- if (!gimplify_ctxp || gimplify_ctxp->current_bind_expr)
- abort ();
+ gcc_assert (gimplify_ctxp && !gimplify_ctxp->current_bind_expr);
for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t))
DECL_GIMPLE_FORMAL_TEMP_P (t) = 0;
@@ -202,13 +199,12 @@ gimple_pop_condition (tree *pre_p)
{
int conds = --(gimplify_ctxp->conditions);
+ gcc_assert (conds >= 0);
if (conds == 0)
{
append_to_statement_list (gimplify_ctxp->conditional_cleanups, pre_p);
gimplify_ctxp->conditional_cleanups = NULL_TREE;
}
- else if (conds < 0)
- abort ();
}
/* A subroutine of append_to_statement_list{,_force}. */
@@ -357,14 +353,11 @@ create_tmp_var (tree type, const char *prefix)
{
tree tmp_var;
-#if defined ENABLE_CHECKING
/* We don't allow types that are addressable (meaning we can't make copies),
incomplete, or of variable size. */
- if (TREE_ADDRESSABLE (type)
- || !COMPLETE_TYPE_P (type)
- || TREE_CODE (TYPE_SIZE_UNIT (type)) != INTEGER_CST)
- abort ();
-#endif
+ gcc_assert (!TREE_ADDRESSABLE (type)
+ && COMPLETE_TYPE_P (type)
+ && TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST);
tmp_var = create_tmp_var_raw (type, prefix);
gimple_add_tmp_var (tmp_var);
@@ -517,8 +510,7 @@ declare_tmp_vars (tree vars, tree scope)
while (TREE_CODE (scope) == COMPOUND_EXPR)
scope = TREE_OPERAND (scope, 0);
- if (TREE_CODE (scope) != BIND_EXPR)
- abort ();
+ gcc_assert (TREE_CODE (scope) == BIND_EXPR);
temps = nreverse (last);
TREE_CHAIN (last) = BIND_EXPR_VARS (scope);
@@ -529,8 +521,7 @@ declare_tmp_vars (tree vars, tree scope)
void
gimple_add_tmp_var (tree tmp)
{
- if (TREE_CHAIN (tmp) || DECL_SEEN_IN_BIND_EXPR_P (tmp))
- abort ();
+ gcc_assert (!TREE_CHAIN (tmp) && !DECL_SEEN_IN_BIND_EXPR_P (tmp));
DECL_CONTEXT (tmp) = current_function_decl;
DECL_SEEN_IN_BIND_EXPR_P (tmp) = 1;
@@ -585,13 +576,10 @@ annotate_all_with_locus (tree *stmt_p, location_t locus)
{
tree t = tsi_stmt (i);
-#ifdef ENABLE_CHECKING
- /* Assuming we've already been gimplified, we shouldn't
- see nested chaining constructs anymore. */
- if (TREE_CODE (t) == STATEMENT_LIST
- || TREE_CODE (t) == COMPOUND_EXPR)
- abort ();
-#endif
+ /* Assuming we've already been gimplified, we shouldn't
+ see nested chaining constructs anymore. */
+ gcc_assert (TREE_CODE (t) != STATEMENT_LIST
+ && TREE_CODE (t) != COMPOUND_EXPR);
annotate_one_with_locus (t, locus);
}
@@ -616,10 +604,11 @@ mostly_copy_tree_r (tree *tp, int *walk_subtrees, void *data)
uses. So just avert our eyes and cross our fingers. Silly Java. */
|| code == BLOCK)
*walk_subtrees = 0;
- else if (code == BIND_EXPR)
- abort ();
else
- copy_tree_r (tp, walk_subtrees, data);
+ {
+ gcc_assert (code != BIND_EXPR);
+ copy_tree_r (tp, walk_subtrees, data);
+ }
return NULL_TREE;
}
@@ -924,12 +913,10 @@ gimplify_return_expr (tree stmt, tree *pre_p)
if (TREE_CODE (result_decl) == INDIRECT_REF)
/* See through a return by reference. */
result_decl = TREE_OPERAND (result_decl, 0);
-#ifdef ENABLE_CHECKING
- if ((TREE_CODE (ret_expr) != MODIFY_EXPR
- && TREE_CODE (ret_expr) != INIT_EXPR)
- || TREE_CODE (result_decl) != RESULT_DECL)
- abort ();
-#endif
+
+ gcc_assert ((TREE_CODE (ret_expr) == MODIFY_EXPR
+ || TREE_CODE (ret_expr) == INIT_EXPR)
+ && TREE_CODE (result_decl) == RESULT_DECL);
}
/* If aggregate_value_p is true, then we can return the bare RESULT_DECL.
@@ -1150,8 +1137,7 @@ gimplify_switch_expr (tree *expr_p, tree *pre_p)
/* If someone can be bothered to fill in the labels, they can
be bothered to null out the body too. */
- if (SWITCH_LABELS (switch_expr))
- abort ();
+ gcc_assert (!SWITCH_LABELS (switch_expr));
saved_labels = gimplify_ctxp->case_labels;
VARRAY_TREE_INIT (gimplify_ctxp->case_labels, 8, "case_labels");
@@ -1201,8 +1187,8 @@ gimplify_switch_expr (tree *expr_p, tree *pre_p)
SWITCH_BODY (switch_expr) = NULL;
}
- else if (!SWITCH_LABELS (switch_expr))
- abort ();
+ else
+ gcc_assert (SWITCH_LABELS (switch_expr));
return ret;
}
@@ -1211,10 +1197,9 @@ static enum gimplify_status
gimplify_case_label_expr (tree *expr_p)
{
tree expr = *expr_p;
- if (gimplify_ctxp->case_labels)
- VARRAY_PUSH_TREE (gimplify_ctxp->case_labels, expr);
- else
- abort ();
+
+ gcc_assert (gimplify_ctxp->case_labels);
+ VARRAY_PUSH_TREE (gimplify_ctxp->case_labels, expr);
*expr_p = build (LABEL_EXPR, void_type_node, CASE_LABEL (expr));
return GS_ALL_DONE;
}
@@ -1248,10 +1233,7 @@ gimplify_exit_block_expr (tree *expr_p)
/* First operand must be a LABELED_BLOCK_EXPR, which should
already be lowered (or partially lowered) when we get here. */
-#if defined ENABLE_CHECKING
- if (TREE_CODE (labeled_block) != LABELED_BLOCK_EXPR)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (labeled_block) == LABELED_BLOCK_EXPR);
label = LABELED_BLOCK_LABEL (labeled_block);
*expr_p = build1 (GOTO_EXPR, void_type_node, label);
@@ -1325,8 +1307,7 @@ canonicalize_component_ref (tree *expr_p)
tree expr = *expr_p;
tree type;
- if (TREE_CODE (expr) != COMPONENT_REF)
- abort ();
+ gcc_assert (TREE_CODE (expr) == COMPONENT_REF);
if (INTEGRAL_TYPE_P (TREE_TYPE (expr)))
type = TREE_TYPE (get_unwidened (expr, NULL_TREE));
@@ -1485,10 +1466,7 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p,
p = &TREE_OPERAND (*p, 0))
VARRAY_PUSH_GENERIC_PTR_NOGC (stack, *p);
-#if defined ENABLE_CHECKING
- if (VARRAY_ACTIVE_SIZE (stack) == 0)
- abort ();
-#endif
+ gcc_assert (VARRAY_ACTIVE_SIZE (stack));
/* Now STACK is a stack of pointers to all the refs we've walked through
and P points to the innermost expression.
@@ -1651,13 +1629,8 @@ gimplify_self_mod_expr (tree *expr_p, tree *pre_p, tree *post_p,
code = TREE_CODE (*expr_p);
-#if defined ENABLE_CHECKING
- if (code != POSTINCREMENT_EXPR
- && code != POSTDECREMENT_EXPR
- && code != PREINCREMENT_EXPR
- && code != PREDECREMENT_EXPR)
- abort ();
-#endif
+ gcc_assert (code == POSTINCREMENT_EXPR || code == POSTDECREMENT_EXPR
+ || code == PREINCREMENT_EXPR || code == PREDECREMENT_EXPR);
/* Prefix or postfix? */
if (code == POSTINCREMENT_EXPR || code == POSTDECREMENT_EXPR)
@@ -1772,10 +1745,7 @@ gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value)
tree arglist;
enum gimplify_status ret;
-#if defined ENABLE_CHECKING
- if (TREE_CODE (*expr_p) != CALL_EXPR)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (*expr_p) == CALL_EXPR);
/* For reliable diagnostics during inlining, it is necessary that
every call_expr be annotated with file and line. */
@@ -2449,11 +2419,9 @@ gimplify_init_ctor_eval (tree object, tree list, tree *pre_p, bool cleared)
{
/* ??? Here's to hoping the front end fills in all of the indicies,
so we don't have to figure out what's missing ourselves. */
- if (!purpose)
- abort ();
+ gcc_assert (purpose);
/* ??? Need to handle this. */
- if (TREE_CODE (purpose) == RANGE_EXPR)
- abort ();
+ gcc_assert (TREE_CODE (purpose) != RANGE_EXPR);
cref = build (ARRAY_REF, array_elt_type, unshare_expr (object),
purpose, NULL_TREE, NULL_TREE);
@@ -2668,8 +2636,7 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
if (elt_list)
{
i = TREE_VALUE (elt_list);
- if (TREE_CHAIN (elt_list))
- abort ();
+ gcc_assert (!TREE_CHAIN (elt_list));
}
}
if (r == NULL || i == NULL)
@@ -2720,7 +2687,7 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
default:
/* So how did we get a CONSTRUCTOR for a scalar type? */
- abort ();
+ gcc_unreachable ();
}
if (ret == GS_ERROR)
@@ -2827,10 +2794,8 @@ gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value)
tree *to_p = &TREE_OPERAND (*expr_p, 0);
enum gimplify_status ret = GS_UNHANDLED;
-#if defined ENABLE_CHECKING
- if (TREE_CODE (*expr_p) != MODIFY_EXPR && TREE_CODE (*expr_p) != INIT_EXPR)
- abort ();
-#endif
+ gcc_assert (TREE_CODE (*expr_p) == MODIFY_EXPR
+ || TREE_CODE (*expr_p) == INIT_EXPR);
/* The distinction between MODIFY_EXPR and INIT_EXPR is no longer useful. */
if (TREE_CODE (*expr_p) == INIT_EXPR)
@@ -2886,8 +2851,7 @@ gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value)
{
/* If we've somehow already got an SSA_NAME on the LHS, then
we're probably modifying it twice. Not good. */
- if (TREE_CODE (*to_p) == SSA_NAME)
- abort ();
+ gcc_assert (TREE_CODE (*to_p) != SSA_NAME);
*to_p = make_ssa_name (*to_p, *expr_p);
}
@@ -3035,11 +2999,7 @@ gimplify_save_expr (tree *expr_p, tree *pre_p, tree *post_p)
enum gimplify_status ret = GS_ALL_DONE;
tree val;
-#if defined ENABLE_CHECKING
- if (TREE_CODE (*expr_p) != SAVE_EXPR)
- abort ();
-#endif
-
+ gcc_assert (TREE_CODE (*expr_p) == SAVE_EXPR);
val = TREE_OPERAND (*expr_p, 0);
/* If the SAVE_EXPR has not been resolved, then evaluate it once. */
@@ -3432,9 +3392,9 @@ gimplify_target_expr (tree *expr_p, tree *pre_p, tree *post_p)
TREE_OPERAND (targ, 3) = init;
TARGET_EXPR_INITIAL (targ) = NULL_TREE;
}
- else if (!DECL_SEEN_IN_BIND_EXPR_P (temp))
+ else
/* We should have expanded this before. */
- abort ();
+ gcc_assert (DECL_SEEN_IN_BIND_EXPR_P (temp));
*expr_p = temp;
return GS_OK;
@@ -3593,7 +3553,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
break;
case TREE_LIST:
- abort ();
+ gcc_unreachable ();
case COMPOUND_EXPR:
ret = gimplify_compound_expr (expr_p, pre_p, fallback != fb_none);
@@ -3729,10 +3689,8 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
case LABEL_EXPR:
ret = GS_ALL_DONE;
-#ifdef ENABLE_CHECKING
- if (decl_function_context (LABEL_EXPR_LABEL (*expr_p)) != current_function_decl)
- abort ();
-#endif
+ gcc_assert (decl_function_context (LABEL_EXPR_LABEL (*expr_p))
+ == current_function_decl);
break;
case CASE_LABEL_EXPR:
@@ -3788,8 +3746,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
case NON_LVALUE_EXPR:
/* This should have been stripped above. */
- abort ();
- break;
+ gcc_unreachable ();
case ASM_EXPR:
ret = gimplify_asm_expr (expr_p, pre_p, post_p);
@@ -3866,10 +3823,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
&& decl_function_context (tmp) == current_function_decl
&& !DECL_SEEN_IN_BIND_EXPR_P (tmp))
{
-#ifdef ENABLE_CHECKING
- if (!errorcount && !sorrycount)
- abort ();
-#endif
+ gcc_assert (errorcount || sorrycount);
ret = GS_ERROR;
break;
}
@@ -3892,49 +3846,58 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
break;
default:
- /* If this is a comparison of objects of aggregate type, handle
- it specially (by converting to a call to memcmp). It would be
- nice to only have to do this for variable-sized objects, but
- then we'd have to allow the same nest of reference nodes we
- allow for MODIFY_EXPR and that's too complex. */
- if (TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '<'
- && (AGGREGATE_TYPE_P (TREE_TYPE (TREE_OPERAND (*expr_p, 1)))))
- ret = gimplify_variable_sized_compare (expr_p);
-
- /* If *EXPR_P does not need to be special-cased, handle it
- according to its class. */
- else if (TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '1')
- ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
- post_p, is_gimple_val, fb_rvalue);
- else if (TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '2'
- || TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '<'
- || TREE_CODE (*expr_p) == TRUTH_AND_EXPR
- || TREE_CODE (*expr_p) == TRUTH_OR_EXPR
- || TREE_CODE (*expr_p) == TRUTH_XOR_EXPR)
+ switch (TREE_CODE_CLASS (TREE_CODE (*expr_p)))
{
- enum gimplify_status r0, r1;
-
- r0 = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
- post_p, is_gimple_val, fb_rvalue);
- r1 = gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p,
- post_p, is_gimple_val, fb_rvalue);
+ case '<':
+ /* If this is a comparison of objects of aggregate type,
+ handle it specially (by converting to a call to
+ memcmp). It would be nice to only have to do this
+ for variable-sized objects, but then we'd have to
+ allow the same nest of reference nodes we allow for
+ MODIFY_EXPR and that's too complex. */
+ if (!AGGREGATE_TYPE_P (TREE_TYPE (TREE_OPERAND (*expr_p, 1))))
+ goto expr_2;
+ ret = gimplify_variable_sized_compare (expr_p);
+ break;
+
+ /* If *EXPR_P does not need to be special-cased, handle it
+ according to its class. */
+ case '1':
+ ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
+ post_p, is_gimple_val, fb_rvalue);
+ break;
- ret = MIN (r0, r1);
- }
- else if (TREE_CODE_CLASS (TREE_CODE (*expr_p)) == 'd'
- || TREE_CODE_CLASS (TREE_CODE (*expr_p)) == 'c')
- {
+ case '2':
+ expr_2:
+ {
+ enum gimplify_status r0, r1;
+
+ r0 = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
+ post_p, is_gimple_val, fb_rvalue);
+ r1 = gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p,
+ post_p, is_gimple_val, fb_rvalue);
+
+ ret = MIN (r0, r1);
+ break;
+ }
+
+ case 'd':
+ case 'c':
ret = GS_ALL_DONE;
- break;
+ goto dont_recalculate;
+
+ default:
+ gcc_assert (TREE_CODE (*expr_p) == TRUTH_AND_EXPR
+ || TREE_CODE (*expr_p) == TRUTH_OR_EXPR
+ || TREE_CODE (*expr_p) == TRUTH_XOR_EXPR);
+ goto expr_2;
}
- else
- /* Fail if we don't know how to handle this tree code. */
- abort ();
recalculate_side_effects (*expr_p);
+ dont_recalculate:
break;
}
-
+
/* If we replaced *expr_p, gimplify again. */
if (ret == GS_OK && (*expr_p == NULL || *expr_p == save_expr))
ret = GS_ALL_DONE;
@@ -3950,12 +3913,9 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
goto out;
}
-#ifdef ENABLE_CHECKING
/* This was only valid as a return value from the langhook, which
we handled. Make sure it doesn't escape from any other context. */
- if (ret == GS_UNHANDLED)
- abort ();
-#endif
+ gcc_assert (ret != GS_UNHANDLED);
if (fallback == fb_none && *expr_p && !is_gimple_stmt (*expr_p))
{
@@ -3969,21 +3929,26 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
has side effects. Recurse through the operands to find it. */
enum tree_code code = TREE_CODE (*expr_p);
- if (code == COMPONENT_REF
- || code == REALPART_EXPR || code == IMAGPART_EXPR)
- gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
- gimple_test_f, fallback);
- else if (code == ARRAY_REF || code == ARRAY_RANGE_REF)
+ switch (code)
{
+ case COMPONENT_REF:
+ case REALPART_EXPR: case IMAGPART_EXPR:
+ gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
+ gimple_test_f, fallback);
+ break;
+
+ case ARRAY_REF: case ARRAY_RANGE_REF:
gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
gimple_test_f, fallback);
gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p,
- gimple_test_f, fallback);
+ gimple_test_f, fallback);
+ break;
+
+ default:
+ /* Anything else with side-effects must be converted to
+ a valid statement before we get here. */
+ gcc_unreachable ();
}
- else
- /* Anything else with side-effects
- must be converted to a valid statement before we get here. */
- abort ();
*expr_p = NULL;
}
@@ -4049,10 +4014,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
}
else if ((fallback & fb_rvalue) && is_gimple_formal_tmp_rhs (*expr_p))
{
-#if defined ENABLE_CHECKING
- if (VOID_TYPE_P (TREE_TYPE (*expr_p)))
- abort ();
-#endif
+ gcc_assert (!VOID_TYPE_P (TREE_TYPE (*expr_p)));
/* An rvalue will do. Assign the gimplified expression into a new
temporary TMP and replace the original expression with TMP. */
@@ -4068,26 +4030,27 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
if (TREE_CODE (*expr_p) != SSA_NAME)
DECL_GIMPLE_FORMAL_TEMP_P (*expr_p) = 1;
}
- else if (fallback & fb_mayfail)
+ else
{
- /* If this is an asm statement, and the user asked for the impossible,
- don't abort. Fail and let gimplify_asm_expr issue an error. */
+#ifdef ENABLE_CHECKING
+ if (!(fallback & fb_mayfail))
+ {
+ fprintf (stderr, "gimplification failed:\n");
+ print_generic_expr (stderr, *expr_p, 0);
+ debug_tree (*expr_p);
+ internal_error ("gimplification failed");
+ }
+#endif
+ gcc_assert (fallback & fb_mayfail);
+ /* If this is an asm statement, and the user asked for the
+ impossible, don't abort. Fail and let gimplify_asm_expr
+ issue an error. */
ret = GS_ERROR;
goto out;
}
- else
- {
- fprintf (stderr, "gimplification failed:\n");
- print_generic_expr (stderr, *expr_p, 0);
- debug_tree (*expr_p);
- abort ();
- }
-#if defined ENABLE_CHECKING
/* Make sure the temporary matches our predicate. */
- if (!(*gimple_test_f) (*expr_p))
- abort ();
-#endif
+ gcc_assert ((*gimple_test_f) (*expr_p));
if (internal_post)
{
@@ -4212,8 +4175,7 @@ check_pointer_types_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
otype = TREE_TYPE (t);
ptype = TREE_TYPE (TREE_OPERAND (t, 0));
dtype = TREE_TYPE (ptype);
- if (!cpt_same_type (otype, dtype))
- abort ();
+ gcc_assert (cpt_same_type (otype, dtype));
break;
case ADDR_EXPR:
@@ -4226,11 +4188,10 @@ check_pointer_types_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
a pointer to the array type. We must allow this in order to
properly represent assigning the address of an array in C into
pointer to the element type. */
- if (TREE_CODE (otype) == ARRAY_TYPE
- && POINTER_TYPE_P (ptype)
- && cpt_same_type (TREE_TYPE (otype), dtype))
- break;
- abort ();
+ gcc_assert (TREE_CODE (otype) == ARRAY_TYPE
+ && POINTER_TYPE_P (ptype)
+ && cpt_same_type (TREE_TYPE (otype), dtype));
+ break;
}
break;
@@ -4373,8 +4334,7 @@ force_gimple_operand (tree expr, tree *stmts, bool simple, tree var)
ret = gimplify_expr (&expr, stmts, NULL,
gimple_test_f, fb_rvalue);
- if (ret == GS_ERROR)
- abort ();
+ gcc_assert (ret != GS_ERROR);
for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t))
add_referenced_tmp_var (t);