From 292c801888be22f65845216cd16ae7adc63802bc Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 9 May 2005 12:10:29 +0000 Subject: [PATCH] iq2000.c (abort_with_insn): Use fancy_abort. * config/iq2000/iq2000.c (abort_with_insn): Use fancy_abort. (gen_int_relational): Use gcc_unreachable and gcc_assert as necessary. (function_arg_advance, function_arg, save_restore_insns, iq2000_expand_prologue, iq2000_output_conditional_branch, expand_one_builtin, print_operand): * config/iq2000/iq2000.md (tablejump): Likewise. From-SVN: r99432 --- gcc/ChangeLog | 9 +++++++++ gcc/config/iq2000/iq2000.c | 40 +++++++++++++--------------------------- gcc/config/iq2000/iq2000.md | 3 +-- 3 files changed, 23 insertions(+), 29 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index caf0d00..0a92374 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2005-05-09 Nathan Sidwell + + * config/iq2000/iq2000.c (abort_with_insn): Use fancy_abort. + (gen_int_relational): Use gcc_unreachable and gcc_assert as necessary. + (function_arg_advance, function_arg, save_restore_insns, + iq2000_expand_prologue, iq2000_output_conditional_branch, + expand_one_builtin, print_operand): + * config/iq2000/iq2000.md (tablejump): Likewise. + 2005-05-09 David Ung * config/mips/mips.h (processor_type): Add names for the 24K. diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index bb695e9..91bb128 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -500,7 +500,7 @@ abort_with_insn (rtx insn, const char * reason) { error (reason); debug_rtx (insn); - abort (); + fancy_abort (__FILE__, __LINE__, __FUNCTION__); } /* Return the appropriate instructions to move one operand to another. */ @@ -872,8 +872,7 @@ gen_int_relational (enum rtx_code test_code, rtx result, rtx cmp0, rtx cmp1, rtx reg2; test = map_test_to_internal_test (test_code); - if (test == ITEST_MAX) - abort (); + gcc_assert (test != ITEST_MAX); p_info = &info[(int) test]; eqne_p = (p_info->test_code == XOR); @@ -1136,9 +1135,8 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, break; default: - if (GET_MODE_CLASS (mode) != MODE_COMPLEX_INT - && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT) - abort (); + gcc_assert (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT + || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT); cum->gp_reg_found = 1; cum->arg_words += ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) @@ -1218,9 +1216,8 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, break; default: - if (GET_MODE_CLASS (mode) != MODE_COMPLEX_INT - && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT) - abort (); + gcc_assert (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT + || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT); /* Drops through. */ case BLKmode: @@ -1250,8 +1247,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, } else { - if (regbase == -1) - abort (); + gcc_assert (regbase != -1); if (! type || TREE_CODE (type) != RECORD_TYPE || ! named || ! TYPE_SIZE_UNIT (type) @@ -1781,9 +1777,8 @@ save_restore_insns (int store_p) HOST_WIDE_INT gp_offset; HOST_WIDE_INT end_offset; - if (frame_pointer_needed - && ! BITSET_P (mask, HARD_FRAME_POINTER_REGNUM - GP_REG_FIRST)) - abort (); + gcc_assert (!frame_pointer_needed + || BITSET_P (mask, HARD_FRAME_POINTER_REGNUM - GP_REG_FIRST)); if (mask == 0) { @@ -1923,8 +1918,7 @@ iq2000_expand_prologue (void) { int words; - if (GET_CODE (entry_parm) != REG) - abort (); + gcc_assert (GET_CODE (entry_parm) == REG); /* Passed in a register, so will get homed automatically. */ if (GET_MODE (entry_parm) == BLKmode) @@ -2430,7 +2424,7 @@ iq2000_output_conditional_branch (rtx insn, rtx * operands, int two_operands_p, } default: - abort (); + gcc_unreachable (); } /* NOTREACHED */ @@ -2637,7 +2631,7 @@ expand_one_builtin (enum insn_code icode, rtx target, tree arglist, pat = GEN_FCN (icode) (op[0], op[1], op[2], op[3]); break; default: - abort (); + gcc_unreachable (); } if (! pat) @@ -3142,15 +3136,7 @@ print_operand (FILE *file, rtx op, int letter) else if (letter == 'Z') { - int regnum; - - if (code != REG) - abort (); - - regnum = REGNO (op); - abort (); - - fprintf (file, "%s,", reg_names[regnum]); + gcc_unreachable (); } else if (code == REG || code == SUBREG) diff --git a/gcc/config/iq2000/iq2000.md b/gcc/config/iq2000/iq2000.md index 208b82c..0528a12 100644 --- a/gcc/config/iq2000/iq2000.md +++ b/gcc/config/iq2000/iq2000.md @@ -1729,8 +1729,7 @@ { if (operands[0]) /* eliminate unused code warnings */ { - if (GET_MODE (operands[0]) != Pmode) - abort (); + gcc_assert (GET_MODE (operands[0]) == Pmode); if (!(Pmode == DImode)) emit_jump_insn (gen_tablejump_internal1 (operands[0], operands[1])); -- 2.7.4