Commit 5e16a15b by Nathan Sidwell Committed by Nathan Sidwell

arc.c (get_arc_condition_code): Use gcc_assert & gcc_unreachable as appropriate.

	* config/arc/arc.c (get_arc_condition_code): Use gcc_assert &
	gcc_unreachable as appropriate.
	(arc_double_limm_p, arc_setup_incoming_varargs,
	arc_compute_function_type, arc_output_function_prologue,
	arc_output_function_epilogue, arc_eligible_for_epilogue_delay,
	output_shift, arc_print_operand, arc_print_operand_address,
	arc_final_prescan_insn): Likewise.
	* config/arc/arc.md (*movdi_insn, *movdf_insn): Likewise.

From-SVN: r99264
parent 0354e5d8
2005-05-05 Nathan Sidwell <nathan@codesourcery.com>
* config/arc/arc.c (get_arc_condition_code): Use gcc_assert &
gcc_unreachable as appropriate.
(arc_double_limm_p, arc_setup_incoming_varargs,
arc_compute_function_type, arc_output_function_prologue,
arc_output_function_epilogue, arc_eligible_for_epilogue_delay,
output_shift, arc_print_operand, arc_print_operand_address,
arc_final_prescan_insn): Likewise.
* config/arc/arc.md (*movdi_insn, *movdf_insn): Likewise.
2005-05-04 Geoffrey Keating <geoffk@apple.com> 2005-05-04 Geoffrey Keating <geoffk@apple.com>
* config/rs6000/rs6000.md (P): Use TARGET_*BIT rather than * config/rs6000/rs6000.md (P): Use TARGET_*BIT rather than
......
...@@ -241,7 +241,7 @@ get_arc_condition_code (rtx comparison) ...@@ -241,7 +241,7 @@ get_arc_condition_code (rtx comparison)
case LEU : return 15; case LEU : return 15;
case LTU : return 6; case LTU : return 6;
case GEU : return 7; case GEU : return 7;
default : abort (); default : gcc_unreachable ();
} }
/*NOTREACHED*/ /*NOTREACHED*/
return (42); return (42);
...@@ -774,8 +774,7 @@ arc_double_limm_p (rtx value) ...@@ -774,8 +774,7 @@ arc_double_limm_p (rtx value)
{ {
HOST_WIDE_INT low, high; HOST_WIDE_INT low, high;
if (GET_CODE (value) != CONST_DOUBLE) gcc_assert (GET_CODE (value) == CONST_DOUBLE);
abort ();
low = CONST_DOUBLE_LOW (value); low = CONST_DOUBLE_LOW (value);
high = CONST_DOUBLE_HIGH (value); high = CONST_DOUBLE_HIGH (value);
...@@ -815,8 +814,7 @@ arc_setup_incoming_varargs (CUMULATIVE_ARGS *cum, ...@@ -815,8 +814,7 @@ arc_setup_incoming_varargs (CUMULATIVE_ARGS *cum,
int first_anon_arg; int first_anon_arg;
/* All BLKmode values are passed by reference. */ /* All BLKmode values are passed by reference. */
if (mode == BLKmode) gcc_assert (mode != BLKmode);
abort ();
first_anon_arg = *cum + ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) first_anon_arg = *cum + ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1)
/ UNITS_PER_WORD); / UNITS_PER_WORD);
...@@ -1061,7 +1059,7 @@ arc_compute_function_type (tree decl) ...@@ -1061,7 +1059,7 @@ arc_compute_function_type (tree decl)
else if (!strcmp (TREE_STRING_POINTER (value), "ilink2")) else if (!strcmp (TREE_STRING_POINTER (value), "ilink2"))
fn_type = ARC_FUNCTION_ILINK2; fn_type = ARC_FUNCTION_ILINK2;
else else
abort (); gcc_unreachable ();
break; break;
} }
} }
...@@ -1229,8 +1227,7 @@ arc_output_function_prologue (FILE *file, HOST_WIDE_INT size) ...@@ -1229,8 +1227,7 @@ arc_output_function_prologue (FILE *file, HOST_WIDE_INT size)
: current_frame_info.total_size); : current_frame_info.total_size);
/* These cases shouldn't happen. Catch them now. */ /* These cases shouldn't happen. Catch them now. */
if (size == 0 && gmask) gcc_assert (size || !gmask);
abort ();
/* Allocate space for register arguments if this is a variadic function. */ /* Allocate space for register arguments if this is a variadic function. */
if (current_frame_info.pretend_size != 0) if (current_frame_info.pretend_size != 0)
...@@ -1317,8 +1314,7 @@ arc_output_function_epilogue (FILE *file, HOST_WIDE_INT size) ...@@ -1317,8 +1314,7 @@ arc_output_function_epilogue (FILE *file, HOST_WIDE_INT size)
if (!can_trust_sp_p) if (!can_trust_sp_p)
{ {
if (!frame_pointer_needed) gcc_assert (frame_pointer_needed);
abort ();
fprintf (file,"\tsub %s,%s,%d\t\t%s sp not trusted here\n", fprintf (file,"\tsub %s,%s,%d\t\t%s sp not trusted here\n",
sp_str, fp_str, frame_size, ASM_COMMENT_START); sp_str, fp_str, frame_size, ASM_COMMENT_START);
} }
...@@ -1400,23 +1396,19 @@ arc_output_function_epilogue (FILE *file, HOST_WIDE_INT size) ...@@ -1400,23 +1396,19 @@ arc_output_function_epilogue (FILE *file, HOST_WIDE_INT size)
fprintf (file, "\tadd %s,%s,16\n", sp_str, sp_str); fprintf (file, "\tadd %s,%s,16\n", sp_str, sp_str);
else if (epilogue_delay != NULL_RTX) else if (epilogue_delay != NULL_RTX)
{ {
if (frame_pointer_needed && !fp_restored_p) gcc_assert (!frame_pointer_needed || fp_restored_p);
abort (); gcc_assert (restored >= size);
if (restored < size)
abort ();
final_scan_insn (XEXP (epilogue_delay, 0), file, 1, 1, NULL); final_scan_insn (XEXP (epilogue_delay, 0), file, 1, 1, NULL);
} }
else if (frame_pointer_needed && !fp_restored_p) else if (frame_pointer_needed && !fp_restored_p)
{ {
if (!SMALL_INT (frame_size)) gcc_assert (SMALL_INT (frame_size));
abort ();
/* Note that we restore fp and sp here! */ /* Note that we restore fp and sp here! */
fprintf (file, "\tld.a %s,[%s,%d]\n", fp_str, sp_str, frame_size); fprintf (file, "\tld.a %s,[%s,%d]\n", fp_str, sp_str, frame_size);
} }
else if (restored < size) else if (restored < size)
{ {
if (!SMALL_INT (size - restored)) gcc_assert (SMALL_INT (size - restored));
abort ();
fprintf (file, "\tadd %s,%s," HOST_WIDE_INT_PRINT_DEC "\n", fprintf (file, "\tadd %s,%s," HOST_WIDE_INT_PRINT_DEC "\n",
sp_str, sp_str, size - restored); sp_str, sp_str, size - restored);
} }
...@@ -1456,8 +1448,7 @@ arc_delay_slots_for_epilogue (void) ...@@ -1456,8 +1448,7 @@ arc_delay_slots_for_epilogue (void)
int int
arc_eligible_for_epilogue_delay (rtx trial, int slot) arc_eligible_for_epilogue_delay (rtx trial, int slot)
{ {
if (slot != 0) gcc_assert (!slot);
abort ();
if (get_attr_length (trial) == 1 if (get_attr_length (trial) == 1
/* If registers where saved, presumably there's more than enough /* If registers where saved, presumably there's more than enough
...@@ -1522,15 +1513,14 @@ output_shift (rtx *operands) ...@@ -1522,15 +1513,14 @@ output_shift (rtx *operands)
enum rtx_code code = GET_CODE (shift); enum rtx_code code = GET_CODE (shift);
const char *shift_one; const char *shift_one;
if (mode != SImode) gcc_assert (mode == SImode);
abort ();
switch (code) switch (code)
{ {
case ASHIFT: shift_one = "asl %0,%0"; break; case ASHIFT: shift_one = "asl %0,%0"; break;
case ASHIFTRT: shift_one = "asr %0,%0"; break; case ASHIFTRT: shift_one = "asr %0,%0"; break;
case LSHIFTRT: shift_one = "lsr %0,%0"; break; case LSHIFTRT: shift_one = "lsr %0,%0"; break;
default: abort (); default: gcc_unreachable ();
} }
if (GET_CODE (operands[2]) != CONST_INT) if (GET_CODE (operands[2]) != CONST_INT)
...@@ -1792,9 +1782,8 @@ arc_print_operand (FILE *file, rtx x, int code) ...@@ -1792,9 +1782,8 @@ arc_print_operand (FILE *file, rtx x, int code)
{ {
char str[30]; char str[30];
if (GET_CODE (x) != CONST_DOUBLE gcc_assert (GET_CODE (x) == CONST_DOUBLE
|| GET_MODE_CLASS (GET_MODE (x)) != MODE_FLOAT) && GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT);
abort ();
real_to_decimal (str, CONST_DOUBLE_REAL_VALUE (x), sizeof (str), 0, 1); real_to_decimal (str, CONST_DOUBLE_REAL_VALUE (x), sizeof (str), 0, 1);
fprintf (file, "%s", str); fprintf (file, "%s", str);
...@@ -1896,26 +1885,33 @@ arc_print_operand_address (FILE *file, rtx addr) ...@@ -1896,26 +1885,33 @@ arc_print_operand_address (FILE *file, rtx addr)
offset = INTVAL (XEXP (addr, 1)), base = XEXP (addr, 0); offset = INTVAL (XEXP (addr, 1)), base = XEXP (addr, 0);
else else
base = XEXP (addr, 0), index = XEXP (addr, 1); base = XEXP (addr, 0), index = XEXP (addr, 1);
if (GET_CODE (base) != REG) gcc_assert (GET_CODE (base) == REG);
abort ();
fputs (reg_names[REGNO (base)], file); fputs (reg_names[REGNO (base)], file);
if (index == 0) if (index == 0)
{ {
if (offset != 0) if (offset != 0)
fprintf (file, ",%d", offset); fprintf (file, ",%d", offset);
} }
else if (GET_CODE (index) == REG) else
{
switch (GET_CODE (index))
{
case REG:
fprintf (file, ",%s", reg_names[REGNO (index)]); fprintf (file, ",%s", reg_names[REGNO (index)]);
else if (GET_CODE (index) == SYMBOL_REF) break;
case SYMBOL_REF:
fputc (',', file), output_addr_const (file, index); fputc (',', file), output_addr_const (file, index);
else break;
abort (); default:
gcc_unreachable ();
}
}
break; break;
case PRE_INC : case PRE_INC :
case PRE_DEC : case PRE_DEC :
/* We shouldn't get here as we've lost the mode of the memory object /* We shouldn't get here as we've lost the mode of the memory object
(which says how much to inc/dec by. */ (which says how much to inc/dec by. */
abort (); gcc_unreachable ();
break; break;
default : default :
output_addr_const (file, addr); output_addr_const (file, addr);
...@@ -2102,7 +2098,7 @@ arc_final_prescan_insn (rtx insn, ...@@ -2102,7 +2098,7 @@ arc_final_prescan_insn (rtx insn,
then_not_else = FALSE; then_not_else = FALSE;
} }
else else
abort (); gcc_unreachable ();
/* See how many insns this branch skips, and what kind of insns. If all /* See how many insns this branch skips, and what kind of insns. If all
insns are okay, and the label or unconditional branch to the same insns are okay, and the label or unconditional branch to the same
...@@ -2221,14 +2217,15 @@ arc_final_prescan_insn (rtx insn, ...@@ -2221,14 +2217,15 @@ arc_final_prescan_insn (rtx insn,
{ {
if ((!seeking_return) && (arc_ccfsm_state == 1 || reverse)) if ((!seeking_return) && (arc_ccfsm_state == 1 || reverse))
arc_ccfsm_target_label = CODE_LABEL_NUMBER (label); arc_ccfsm_target_label = CODE_LABEL_NUMBER (label);
else if (seeking_return || arc_ccfsm_state == 2) else
{ {
gcc_assert (seeking_return || arc_ccfsm_state == 2);
while (this_insn && GET_CODE (PATTERN (this_insn)) == USE) while (this_insn && GET_CODE (PATTERN (this_insn)) == USE)
{ {
this_insn = next_nonnote_insn (this_insn); this_insn = next_nonnote_insn (this_insn);
if (this_insn && (GET_CODE (this_insn) == BARRIER gcc_assert (!this_insn
|| GET_CODE (this_insn) == CODE_LABEL)) || (GET_CODE (this_insn) != BARRIER
abort (); && GET_CODE (this_insn) != CODE_LABEL));
} }
if (!this_insn) if (!this_insn)
{ {
...@@ -2240,8 +2237,6 @@ arc_final_prescan_insn (rtx insn, ...@@ -2240,8 +2237,6 @@ arc_final_prescan_insn (rtx insn,
} }
arc_ccfsm_target_insn = this_insn; arc_ccfsm_target_insn = this_insn;
} }
else
abort ();
/* If REVERSE is true, ARM_CURRENT_CC needs to be inverted from /* If REVERSE is true, ARM_CURRENT_CC needs to be inverted from
what it was. */ what it was. */
......
...@@ -299,7 +299,7 @@ ...@@ -299,7 +299,7 @@
case 3 : case 3 :
return \"st%V0 %1,%0\;st%V0 %R1,%R0\"; return \"st%V0 %1,%0\;st%V0 %R1,%R0\";
default: default:
abort(); gcc_unreachable ();
} }
}" }"
[(set_attr "type" "move,move,load,store") [(set_attr "type" "move,move,load,store")
...@@ -392,7 +392,7 @@ ...@@ -392,7 +392,7 @@
case 3 : case 3 :
return \"st%V0 %1,%0\;st%V0 %R1,%R0\"; return \"st%V0 %1,%0\;st%V0 %R1,%R0\";
default: default:
abort(); gcc_unreachable ();
} }
}" }"
[(set_attr "type" "move,move,load,store") [(set_attr "type" "move,move,load,store")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment