This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Assertify iq2000
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, scox at redhat dot com
- Date: Mon, 09 May 2005 12:38:57 +0100
- Subject: Assertify iq2000
This patch assertifies the iq2000 target files. Built and tested
with i686 hosted cross tools, newlib and simulator. ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2005-05-09 Nathan Sidwell <nathan@codesourcery.com>
* 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.
Index: config/iq2000/iq2000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/iq2000/iq2000.c,v
retrieving revision 1.34
diff -c -3 -p -r1.34 iq2000.c
*** config/iq2000/iq2000.c 28 Apr 2005 05:38:39 -0000 1.34
--- config/iq2000/iq2000.c 9 May 2005 11:24:57 -0000
*************** abort_with_insn (rtx insn, const char *
*** 500,506 ****
{
error (reason);
debug_rtx (insn);
! abort ();
}
/* Return the appropriate instructions to move one operand to another. */
--- 500,506 ----
{
error (reason);
debug_rtx (insn);
! fancy_abort (__FILE__, __LINE__, __FUNCTION__);
}
/* Return the appropriate instructions to move one operand to another. */
*************** gen_int_relational (enum rtx_code test_c
*** 872,879 ****
rtx reg2;
test = map_test_to_internal_test (test_code);
! if (test == ITEST_MAX)
! abort ();
p_info = &info[(int) test];
eqne_p = (p_info->test_code == XOR);
--- 872,878 ----
rtx reg2;
test = map_test_to_internal_test (test_code);
! gcc_assert (test != ITEST_MAX);
p_info = &info[(int) test];
eqne_p = (p_info->test_code == XOR);
*************** function_arg_advance (CUMULATIVE_ARGS *c
*** 1136,1144 ****
break;
default:
! if (GET_MODE_CLASS (mode) != MODE_COMPLEX_INT
! && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT)
! abort ();
cum->gp_reg_found = 1;
cum->arg_words += ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1)
--- 1135,1142 ----
break;
default:
! 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)
*************** function_arg (CUMULATIVE_ARGS *cum, enum
*** 1218,1226 ****
break;
default:
! if (GET_MODE_CLASS (mode) != MODE_COMPLEX_INT
! && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT)
! abort ();
/* Drops through. */
case BLKmode:
--- 1216,1223 ----
break;
default:
! gcc_assert (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT
! || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT);
/* Drops through. */
case BLKmode:
*************** function_arg (CUMULATIVE_ARGS *cum, enum
*** 1250,1257 ****
}
else
{
! if (regbase == -1)
! abort ();
if (! type || TREE_CODE (type) != RECORD_TYPE
|| ! named || ! TYPE_SIZE_UNIT (type)
--- 1247,1253 ----
}
else
{
! gcc_assert (regbase != -1);
if (! type || TREE_CODE (type) != RECORD_TYPE
|| ! named || ! TYPE_SIZE_UNIT (type)
*************** save_restore_insns (int store_p)
*** 1781,1789 ****
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 ();
if (mask == 0)
{
--- 1777,1784 ----
HOST_WIDE_INT gp_offset;
HOST_WIDE_INT end_offset;
! gcc_assert (!frame_pointer_needed
! || BITSET_P (mask, HARD_FRAME_POINTER_REGNUM - GP_REG_FIRST));
if (mask == 0)
{
*************** iq2000_expand_prologue (void)
*** 1923,1930 ****
{
int words;
! if (GET_CODE (entry_parm) != REG)
! abort ();
/* Passed in a register, so will get homed automatically. */
if (GET_MODE (entry_parm) == BLKmode)
--- 1918,1924 ----
{
int words;
! gcc_assert (GET_CODE (entry_parm) == REG);
/* Passed in a register, so will get homed automatically. */
if (GET_MODE (entry_parm) == BLKmode)
*************** iq2000_output_conditional_branch (rtx in
*** 2430,2436 ****
}
default:
! abort ();
}
/* NOTREACHED */
--- 2424,2430 ----
}
default:
! gcc_unreachable ();
}
/* NOTREACHED */
*************** expand_one_builtin (enum insn_code icode
*** 2637,2643 ****
pat = GEN_FCN (icode) (op[0], op[1], op[2], op[3]);
break;
default:
! abort ();
}
if (! pat)
--- 2631,2637 ----
pat = GEN_FCN (icode) (op[0], op[1], op[2], op[3]);
break;
default:
! gcc_unreachable ();
}
if (! pat)
*************** print_operand (FILE *file, rtx op, int l
*** 3142,3156 ****
else if (letter == 'Z')
{
! int regnum;
!
! if (code != REG)
! abort ();
!
! regnum = REGNO (op);
! abort ();
!
! fprintf (file, "%s,", reg_names[regnum]);
}
else if (code == REG || code == SUBREG)
--- 3136,3142 ----
else if (letter == 'Z')
{
! gcc_unreachable ();
}
else if (code == REG || code == SUBREG)
Index: config/iq2000/iq2000.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/iq2000/iq2000.md,v
retrieving revision 1.8
diff -c -3 -p -r1.8 iq2000.md
*** config/iq2000/iq2000.md 3 Apr 2005 00:38:00 -0000 1.8
--- config/iq2000/iq2000.md 9 May 2005 11:24:58 -0000
***************
*** 1729,1736 ****
{
if (operands[0]) /* eliminate unused code warnings */
{
! if (GET_MODE (operands[0]) != Pmode)
! abort ();
if (!(Pmode == DImode))
emit_jump_insn (gen_tablejump_internal1 (operands[0], operands[1]));
--- 1729,1735 ----
{
if (operands[0]) /* eliminate unused code warnings */
{
! gcc_assert (GET_MODE (operands[0]) == Pmode);
if (!(Pmode == DImode))
emit_jump_insn (gen_tablejump_internal1 (operands[0], operands[1]));