integer_type_node);
DECL_FIELD_CONTEXT (f_cs) = sjlj_fc_type_node;
- tmp = build_index_type (build_int_2 (4 - 1, 0));
+ tmp = build_index_type (build_int_cst (NULL_TREE, 4 - 1));
tmp = build_array_type (lang_hooks.types.type_for_mode (word_mode, 1),
tmp);
f_data = build_decl (FIELD_DECL, get_identifier ("__data"), tmp);
#ifdef DONT_USE_BUILTIN_SETJMP
#ifdef JMP_BUF_SIZE
- tmp = build_int_2 (JMP_BUF_SIZE - 1, 0);
+ tmp = build_int_cst (NULL_TREE, JMP_BUF_SIZE - 1);
#else
/* Should be large enough for most systems, if it is not,
JMP_BUF_SIZE should be defined with the proper value. It will
also tend to be larger than necessary for most systems, a more
optimal port will define JMP_BUF_SIZE. */
- tmp = build_int_2 (FIRST_PSEUDO_REGISTER + 2 - 1, 0);
+ tmp = build_int_cst (NULL_TREE, FIRST_PSEUDO_REGISTER + 2 - 1);
#endif
#else
/* builtin_setjmp takes a pointer to 5 words. */
- tmp = build_int_2 (5 * BITS_PER_WORD / POINTER_SIZE - 1, 0);
+ tmp = build_int_cst (NULL_TREE, 5 * BITS_PER_WORD / POINTER_SIZE - 1);
#endif
tmp = build_index_type (tmp);
tmp = build_array_type (ptr_type_node, tmp);
struct eh_region *new;
#ifdef ENABLE_CHECKING
- if (! doing_eh (0))
- abort ();
+ gcc_assert (doing_eh (0));
#endif
/* Insert a new blank region as a leaf in the tree. */
rtx filter = fun->eh->filter;
if (fun == cfun && ! filter)
{
- filter = gen_reg_rtx (word_mode);
+ filter = gen_reg_rtx (targetm.eh_return_filter_mode ());
fun->eh->filter = filter;
}
return filter;
&& cleanup->u.cleanup.exp == fixup->u.fixup.cleanup_exp)
break;
}
- if (j > n)
- abort ();
+ gcc_assert (j <= n);
real = cleanup->outer;
if (real && real->type == ERT_FIXUP)
if (r->resume)
{
- if (uid_region_num[INSN_UID (r->resume)])
- abort ();
+ gcc_assert (!uid_region_num[INSN_UID (r->resume)]);
uid_region_num[INSN_UID (r->resume)] = i;
}
if (r->label)
{
- if (uid_region_num[INSN_UID (r->label)])
- abort ();
+ gcc_assert (!uid_region_num[INSN_UID (r->label)]);
uid_region_num[INSN_UID (r->label)] = i;
}
}
for (insn = *pinsns; insn ; insn = next)
{
next = NEXT_INSN (insn);
- if (GET_CODE (insn) == NOTE)
+ if (NOTE_P (insn))
{
int kind = NOTE_LINE_NUMBER (insn);
if (kind == NOTE_INSN_EH_REGION_BEG
/* Calls can always potentially throw exceptions, unless
they have a REG_EH_REGION note with a value of 0 or less.
Which should be the only possible kind so far. */
- && (GET_CODE (insn) == CALL_INSN
+ && (CALL_P (insn)
/* If we wanted exceptions for non-call insns, then
any may_trap_p instruction could throw. */
|| (flag_non_call_exceptions
}
}
- if (sp != orig_sp)
- abort ();
+ gcc_assert (sp == orig_sp);
}
static void
label. After landing pad creation, the exception handlers may
share landing pads. This is ok, since maybe_remove_eh_handler
only requires the 1-1 mapping before landing pad creation. */
- if (*slot && !cfun->eh->built_landing_pads)
- abort ();
+ gcc_assert (!*slot || cfun->eh->built_landing_pads);
*slot = entry;
}
n->u.throw.type = o->u.throw.type;
default:
- abort ();
+ gcc_unreachable ();
}
if (o->label)
if (o->resume)
{
n->resume = map->insn_map[INSN_UID (o->resume)];
- if (n->resume == NULL)
- abort ();
+ gcc_assert (n->resume);
}
return n;
for (;tp_node; tp_node = TREE_CHAIN (tp_node))
{
int flt = add_ttypes_entry (ttypes, TREE_VALUE (tp_node));
- tree flt_node = build_int_2 (flt, 0);
+ tree flt_node = build_int_cst (NULL_TREE, flt);
r->u.catch.filter_list
= tree_cons (NULL_TREE, flt_node, r->u.catch.filter_list);
/* Get a filter value for the NULL list also since it will need
an action record anyway. */
int flt = add_ttypes_entry (ttypes, NULL);
- tree flt_node = build_int_2 (flt, 0);
+ tree flt_node = build_int_cst (NULL_TREE, flt);
r->u.catch.filter_list
= tree_cons (NULL_TREE, flt_node, r->u.catch.filter_list);
if (e->flags & EDGE_FALLTHRU)
force_nonfallthru (e);
last = emit_insn_before (seq, insn);
- if (GET_CODE (last) == BARRIER)
+ if (BARRIER_P (last))
last = PREV_INSN (last);
bb = create_basic_block (seq, last, BLOCK_FOR_INSN (insn)->prev_bb);
update_bb_for_insn (bb);
emit_cmp_and_jump_insns
(cfun->eh->filter,
GEN_INT (tree_low_cst (TREE_VALUE (flt_node), 0)),
- EQ, NULL_RTX, word_mode, 0, c->label);
+ EQ, NULL_RTX,
+ targetm.eh_return_filter_mode (), 0, c->label);
tp_node = TREE_CHAIN (tp_node);
flt_node = TREE_CHAIN (flt_node);
emit_cmp_and_jump_insns (cfun->eh->filter,
GEN_INT (region->u.allowed.filter),
- EQ, NULL_RTX, word_mode, 0, region->label);
+ EQ, NULL_RTX,
+ targetm.eh_return_filter_mode (), 0, region->label);
/* We delay the generation of the _Unwind_Resume until we generate
landing pads. We emit a marker here so as to get good control
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
}
end_sequence ();
barrier = emit_insn_before (seq, region->resume);
/* Avoid duplicate barrier. */
- if (GET_CODE (barrier) != BARRIER)
- abort ();
+ gcc_assert (BARRIER_P (barrier));
delete_insn (barrier);
delete_insn (region->resume);
emit_move_insn (cfun->eh->exc_ptr,
gen_rtx_REG (ptr_mode, EH_RETURN_DATA_REGNO (0)));
emit_move_insn (cfun->eh->filter,
- gen_rtx_REG (word_mode, EH_RETURN_DATA_REGNO (1)));
+ gen_rtx_REG (targetm.eh_return_filter_mode (),
+ EH_RETURN_DATA_REGNO (1)));
seq = get_insns ();
end_sequence ();
rtx note, before, p;
/* Reset value tracking at extended basic block boundaries. */
- if (GET_CODE (insn) == CODE_LABEL)
+ if (LABEL_P (insn))
last_call_site = -2;
if (! INSN_P (insn))
/* Calls (and trapping insns) without notes are outside any
exception handling region in this function. Mark them as
no action. */
- if (GET_CODE (insn) == CALL_INSN
+ if (CALL_P (insn)
|| (flag_non_call_exceptions
&& may_trap_p (PATTERN (insn))))
this_call_site = -1;
/* Don't separate a call from it's argument loads. */
before = insn;
- if (GET_CODE (insn) == CALL_INSN)
+ if (CALL_P (insn))
before = find_first_parameter_load (insn, NULL_RTX);
start_sequence ();
can_throw_internal instructions. */
for (fn_begin = get_insns (); ; fn_begin = NEXT_INSN (fn_begin))
- if (GET_CODE (fn_begin) == NOTE
+ if (NOTE_P (fn_begin)
&& (NOTE_LINE_NUMBER (fn_begin) == NOTE_INSN_FUNCTION_BEG
|| NOTE_LINE_NUMBER (fn_begin) == NOTE_INSN_BASIC_BLOCK))
break;
{
rtx last = BB_END (ENTRY_BLOCK_PTR->succ->dest);
for (; ; fn_begin = NEXT_INSN (fn_begin))
- if ((GET_CODE (fn_begin) == NOTE
+ if ((NOTE_P (fn_begin)
&& NOTE_LINE_NUMBER (fn_begin) == NOTE_INSN_FUNCTION_BEG)
|| fn_begin == last)
break;
/* Figure out whether the place we are supposed to insert libcall
is inside the last basic block or after it. In the other case
we need to emit to edge. */
- if (e->src->next_bb != EXIT_BLOCK_PTR)
- abort ();
+ gcc_assert (e->src->next_bb == EXIT_BLOCK_PTR);
for (insn = NEXT_INSN (BB_END (e->src)); insn; insn = NEXT_INSN (insn))
if (insn == cfun->eh->sjlj_exit_after)
break;
else
{
insn = cfun->eh->sjlj_exit_after;
- if (GET_CODE (insn) == CODE_LABEL)
+ if (LABEL_P (insn))
insn = NEXT_INSN (insn);
emit_insn_after (seq, insn);
}
connect many of the handlers, and then type information will not
be effective. Still, this is a win over previous implementations. */
- cleanup_cfg (CLEANUP_PRE_LOOP | CLEANUP_NO_INSN_DEL);
-
/* These registers are used by the landing pads. Make sure they
have been generated. */
get_exception_pointer (cfun);
if (eh)
rtl_make_eh_edge (NULL, bb, BB_END (bb));
}
- cleanup_cfg (CLEANUP_PRE_LOOP | CLEANUP_NO_INSN_DEL);
}
\f
static hashval_t
tmp.label = label;
slot = (struct ehl_map_entry **)
htab_find_slot (cfun->eh->exception_handler_label_map, &tmp, NO_INSERT);
- if (! slot)
- abort ();
+ gcc_assert (slot);
htab_clear_slot (cfun->eh->exception_handler_label_map, (void **) slot);
}
try->type == ERT_CATCH;
try = try->next_peer)
continue;
- if (try->type != ERT_TRY)
- abort ();
+ gcc_assert (try->type == ERT_TRY);
next = region->u.catch.next_catch;
prev = region->u.catch.prev_catch;
case ERT_FIXUP:
case ERT_UNKNOWN:
/* Shouldn't see these here. */
+ gcc_unreachable ();
break;
+ default:
+ gcc_unreachable ();
}
-
- abort ();
}
/* Invoke CALLBACK on each region reachable from REGION_NUMBER. */
rtx handlers = NULL;
int region_number;
- if (GET_CODE (insn) == JUMP_INSN
+ if (JUMP_P (insn)
&& GET_CODE (PATTERN (insn)) == RESX)
{
region_number = XINT (PATTERN (insn), 0);
if (! INSN_P (insn))
return false;
- if (GET_CODE (insn) == JUMP_INSN
+ if (JUMP_P (insn)
&& GET_CODE (PATTERN (insn)) == RESX
&& XINT (PATTERN (insn), 0) > 0)
return can_throw_internal_1 (XINT (PATTERN (insn), 0));
- if (GET_CODE (insn) == INSN
+ if (NONJUMP_INSN_P (insn)
&& GET_CODE (PATTERN (insn)) == SEQUENCE)
insn = XVECEXP (PATTERN (insn), 0, 0);
if (! INSN_P (insn))
return false;
- if (GET_CODE (insn) == INSN
+ if (NONJUMP_INSN_P (insn)
&& GET_CODE (PATTERN (insn)) == SEQUENCE)
insn = XVECEXP (PATTERN (insn), 0, 0);
assume it might throw. Given that the front end and middle
ends mark known NOTHROW functions, this isn't so wildly
inaccurate. */
- return (GET_CODE (insn) == CALL_INSN
+ return (CALL_P (insn)
|| (flag_non_call_exceptions
&& may_trap_p (PATTERN (insn))));
}
{
TREE_NOTHROW (current_function_decl) = 0;
- if (GET_CODE (insn) != CALL_INSN || !SIBLING_CALL_P (insn))
+ if (!CALL_P (insn) || !SIBLING_CALL_P (insn))
{
cfun->all_throwers_are_sibcalls = 0;
return;
{
TREE_NOTHROW (current_function_decl) = 0;
- if (GET_CODE (insn) != CALL_INSN || !SIBLING_CALL_P (insn))
+ if (!CALL_P (insn) || !SIBLING_CALL_P (insn))
{
cfun->all_throwers_are_sibcalls = 0;
return;
return collect_one_action_chain (ar_hash, region->outer);
default:
- abort ();
+ gcc_unreachable ();
}
}
rtx this_landing_pad;
insn = iter;
- if (GET_CODE (insn) == INSN
+ if (NONJUMP_INSN_P (insn)
&& GET_CODE (PATTERN (insn)) == SEQUENCE)
insn = XVECEXP (PATTERN (insn), 0, 0);
note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
if (!note)
{
- if (! (GET_CODE (insn) == CALL_INSN
+ if (! (CALL_P (insn)
|| (flag_non_call_exceptions
&& may_trap_p (PATTERN (insn)))))
continue;
if (! cfun->uses_eh_lsda)
return;
-#ifdef IA64_UNWIND_INFO
+#ifdef TARGET_UNWIND_INFO
+ /* TODO: Move this into target file. */
fputs ("\t.personality\t", asm_out_file);
output_addr_const (asm_out_file, eh_personality_libfunc);
fputs ("\n\t.handlerdata\n", asm_out_file);
cgraph_varpool_mark_needed_node (node);
}
}
- else if (TREE_CODE (type) != INTEGER_CST)
- abort ();
+ else
+ gcc_assert (TREE_CODE (type) == INTEGER_CST);
}
if (tt_format == DW_EH_PE_absptr || tt_format == DW_EH_PE_aligned)