summaryrefslogtreecommitdiff
path: root/gcc/caller-save.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-07 10:19:00 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-07 10:19:00 +0000
commit231bd014bbdc801d1b137f8989b0d0c2541fd0f7 (patch)
treedd4f142a645a4fabe170becf3c587e3d8176358c /gcc/caller-save.c
parenta1fa05f04b8b8d1174e1e75aafe203366e0d4d93 (diff)
downloadgcc-231bd014bbdc801d1b137f8989b0d0c2541fd0f7.tar.gz
* c-aux-info.c (gen_type): Use gcc_assert or gcc_unreachable.
* c-common.c (c_type_hash, c_common_nodes_and_builtins, c_expand_expr, boolean_increment, nonnull_check_p, check_function_arguments_recurse, fold_offsetof_1): Likewise. * c-cppbuiltin.c (define__GNUC__, builtin_define_stdint_macros, builtin_define_type_max): Likewise. * c-decl.c (bind, pop_scope, merge_decls, pushdecl_top_level, implicit_decl_warning, builtin_function, build_compound_literal, complete_array_type, grokdeclarator, get_parm_info, start_function, store_parm_decls_oldstyle, c_write_global_declarations): Likewise. * c-format.c (get_constant, decode_format_attr, maybe_read_dollar_number, get_flag_spec, check_format_arg, check_format_types, format_type_warning, find_char_info_specifier_index, init_dynamic_asm_fprintf_info, init_dynamic_diag_info, handle_format_attribute): Likewise. * c-gimplify.c (push_context, pop_context, finish_bc_block): * c-lex.c (c_lex_with_flags, lex_string): Likewise. * c-objc-common.c (c_tree_printer): Likewise. * c-pch.c (pch_init): Likewise. * c-pragma.c (maybe_apply_pragma_weak): Likewise. * c-pretty-print.c (pp_c_tree_decl_identifier): Likewise. * c-typeck.c (c_incomplete_type_error, composite_type, common_pointer_type, common_type, same_translation_unit_p, tagged_types_tu_compatible_p, finish_init, pop_init_level, set_designator, set_nonincremental_init_from_string, process_init_element, c_finish_if_stmt): Likewise. * caller-save.c (init_caller_save, save_call_clobbered_regs, insert_restore, insert_save, insert_one_insn): Likewise. * calls.c (emit_call_1, compute_argument_block_size, precompute_arguments, expand_call, emit_library_call_value_1, store_one_arg): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87140 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/caller-save.c')
-rw-r--r--gcc/caller-save.c45
1 files changed, 16 insertions, 29 deletions
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index aa9b5845a41..53446f38ec3 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -160,8 +160,7 @@ init_caller_save (void)
[(int) MODE_BASE_REG_CLASS (regno_save_mode [i][1])], i))
break;
- if (i == FIRST_PSEUDO_REGISTER)
- abort ();
+ gcc_assert (i < FIRST_PSEUDO_REGISTER);
addr_reg = gen_rtx_REG (Pmode, i);
@@ -381,8 +380,7 @@ save_call_clobbered_regs (void)
next = chain->next;
- if (chain->is_caller_save_insn)
- abort ();
+ gcc_assert (!chain->is_caller_save_insn);
if (INSN_P (insn))
{
@@ -431,22 +429,17 @@ save_call_clobbered_regs (void)
{
int r = reg_renumber[regno];
int nregs;
-
- if (r >= 0)
- {
- enum machine_mode mode;
-
- nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)];
- mode = HARD_REGNO_CALLER_SAVE_MODE
- (r, nregs, PSEUDO_REGNO_MODE (regno));
- if (GET_MODE_BITSIZE (mode)
- > GET_MODE_BITSIZE (save_mode[r]))
- save_mode[r] = mode;
- while (nregs-- > 0)
- SET_HARD_REG_BIT (hard_regs_to_save, r + nregs);
- }
- else
- abort ();
+ enum machine_mode mode;
+
+ gcc_assert (r >= 0);
+ nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)];
+ mode = HARD_REGNO_CALLER_SAVE_MODE
+ (r, nregs, PSEUDO_REGNO_MODE (regno));
+ if (GET_MODE_BITSIZE (mode)
+ > GET_MODE_BITSIZE (save_mode[r]))
+ save_mode[r] = mode;
+ while (nregs-- > 0)
+ SET_HARD_REG_BIT (hard_regs_to_save, r + nregs);
});
/* Record all registers set in this call insn. These don't need
@@ -650,9 +643,7 @@ insert_restore (struct insn_chain *chain, int before_p, int regno,
or SET_SRC. Instead of doing so and causing a crash later, check
for this common case and abort here instead. This will remove one
step in debugging such problems. */
-
- if (regno_save_mem[regno][1] == 0)
- abort ();
+ gcc_assert (regno_save_mem[regno][1]);
/* Get the pattern to emit and update our status.
@@ -725,9 +716,7 @@ insert_save (struct insn_chain *chain, int before_p, int regno,
or SET_SRC. Instead of doing so and causing a crash later, check
for this common case and abort here instead. This will remove one
step in debugging such problems. */
-
- if (regno_save_mem[regno][1] == 0)
- abort ();
+ gcc_assert (regno_save_mem[regno][1]);
/* Get the pattern to emit and update our status.
@@ -824,9 +813,7 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat)
rtx reg = XEXP (link, 0);
int regno, i;
- if (!REG_P (reg))
- abort ();
-
+ gcc_assert (REG_P (reg));
regno = REGNO (reg);
if (regno >= FIRST_PSEUDO_REGISTER)
regno = reg_renumber[regno];