Commit 75c3cfba by Nathan Sidwell Committed by Nathan Sidwell

m32r.c (m32r_encode_section_info): Use gcc_assert and gcc_unreachable, as appropriate.

	* config/m32r/m32r.c (m32r_encode_section_info): Use gcc_assert
	and gcc_unreachable, as appropriate.
	(gen_compare, gen_split_move_double, m32r_setup_incoming_varargs,
	m32r_expand_prologue, m32r_output_function_epilogue,
	m32r_legitimize_pic_address, m32r_print_operand_address,
	emit_cond_move, m32r_function_symbol,
	m32r_output_block_move): Likewise.
	* config/m32r/m32r.h (INITIAL_ELIMINATION_OFFSET): Likewise.
	* config/m32r/m32r.md (	*movsi_insn, *zero_branch_insn,
	*rev_zero_branch_insn): Likewise.

From-SVN: r99309
parent 46fb43a7
2005-05-06 Nathan Sidwell <nathan@codesourcery.com>
* config/m32r/m32r.c (m32r_encode_section_info): Use gcc_assert
and gcc_unreachable, as appropriate.
(gen_compare, gen_split_move_double, m32r_setup_incoming_varargs,
m32r_expand_prologue, m32r_output_function_epilogue,
m32r_legitimize_pic_address, m32r_print_operand_address,
emit_cond_move, m32r_function_symbol,
m32r_output_block_move): Likewise.
* config/m32r/m32r.h (INITIAL_ELIMINATION_OFFSET): Likewise.
* config/m32r/m32r.md ( *movsi_insn, *zero_branch_insn,
*rev_zero_branch_insn): Likewise.
2005-05-06 Jakub Jelinek <jakub@redhat.com> 2005-05-06 Jakub Jelinek <jakub@redhat.com>
PR c++/20961 PR c++/20961
......
...@@ -432,7 +432,7 @@ m32r_encode_section_info (tree decl, rtx rtl, int first) ...@@ -432,7 +432,7 @@ m32r_encode_section_info (tree decl, rtx rtl, int first)
else if (id == large_ident1 || id == large_ident2) else if (id == large_ident1 || id == large_ident2)
model = M32R_MODEL_LARGE; model = M32R_MODEL_LARGE;
else else
abort (); /* shouldn't happen */ gcc_unreachable (); /* shouldn't happen */
} }
else else
{ {
...@@ -443,7 +443,7 @@ m32r_encode_section_info (tree decl, rtx rtl, int first) ...@@ -443,7 +443,7 @@ m32r_encode_section_info (tree decl, rtx rtl, int first)
else if (TARGET_MODEL_LARGE) else if (TARGET_MODEL_LARGE)
model = M32R_MODEL_LARGE; model = M32R_MODEL_LARGE;
else else
abort (); /* shouldn't happen */ gcc_unreachable (); /* shouldn't happen */
} }
extra_flags |= model << SYMBOL_FLAG_MODEL_SHIFT; extra_flags |= model << SYMBOL_FLAG_MODEL_SHIFT;
...@@ -700,7 +700,7 @@ gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare) ...@@ -700,7 +700,7 @@ gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare)
case GEU: compare_code = LTU; branch_code = EQ; break; case GEU: compare_code = LTU; branch_code = EQ; break;
default: default:
abort (); gcc_unreachable ();
} }
if (need_compare) if (need_compare)
...@@ -766,7 +766,7 @@ gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare) ...@@ -766,7 +766,7 @@ gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare)
code = NE; code = NE;
break; break;
default: default:
abort (); gcc_unreachable ();
} }
return gen_rtx_fmt_ee (code, CCmode, cc_reg, const0_rtx); return gen_rtx_fmt_ee (code, CCmode, cc_reg, const0_rtx);
...@@ -806,7 +806,7 @@ gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare) ...@@ -806,7 +806,7 @@ gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare)
code = NE; code = NE;
break; break;
default: default:
abort(); gcc_unreachable ();
} }
return gen_rtx_fmt_ee (code, CCmode, cc_reg, const0_rtx); return gen_rtx_fmt_ee (code, CCmode, cc_reg, const0_rtx);
...@@ -814,7 +814,7 @@ gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare) ...@@ -814,7 +814,7 @@ gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare)
break; break;
default: default:
abort(); gcc_unreachable ();
} }
} }
else else
...@@ -876,7 +876,7 @@ gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare) ...@@ -876,7 +876,7 @@ gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
return gen_rtx_fmt_ee (branch_code, VOIDmode, cc_reg, CONST0_RTX (CCmode)); return gen_rtx_fmt_ee (branch_code, VOIDmode, cc_reg, CONST0_RTX (CCmode));
...@@ -968,7 +968,7 @@ gen_split_move_double (rtx operands[]) ...@@ -968,7 +968,7 @@ gen_split_move_double (rtx operands[])
!reverse * UNITS_PER_WORD))); !reverse * UNITS_PER_WORD)));
} }
else else
abort (); gcc_unreachable ();
} }
/* Mem = reg. */ /* Mem = reg. */
...@@ -995,7 +995,7 @@ gen_split_move_double (rtx operands[]) ...@@ -995,7 +995,7 @@ gen_split_move_double (rtx operands[])
} }
else else
abort (); gcc_unreachable ();
val = get_insns (); val = get_insns ();
end_sequence (); end_sequence ();
...@@ -1049,8 +1049,7 @@ m32r_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, ...@@ -1049,8 +1049,7 @@ m32r_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
return; return;
/* 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 = (ROUND_ADVANCE_CUM (*cum, mode, type) first_anon_arg = (ROUND_ADVANCE_CUM (*cum, mode, type)
+ ROUND_ADVANCE_ARG (mode, type)); + ROUND_ADVANCE_ARG (mode, type));
...@@ -1401,8 +1400,7 @@ m32r_expand_prologue (void) ...@@ -1401,8 +1400,7 @@ m32r_expand_prologue (void)
gmask = current_frame_info.gmask; gmask = current_frame_info.gmask;
/* These cases shouldn't happen. Catch them now. */ /* These cases shouldn't happen. Catch them now. */
if (current_frame_info.total_size == 0 && gmask) gcc_assert (current_frame_info.total_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)
...@@ -1512,8 +1510,7 @@ m32r_output_function_epilogue (FILE * file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) ...@@ -1512,8 +1510,7 @@ m32r_output_function_epilogue (FILE * file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
/* This is only for the human reader. */ /* This is only for the human reader. */
fprintf (file, "\t%s EPILOGUE\n", ASM_COMMENT_START); fprintf (file, "\t%s EPILOGUE\n", ASM_COMMENT_START);
if (!current_frame_info.initialized) gcc_assert (current_frame_info.initialized);
abort ();
total_size = current_frame_info.total_size; total_size = current_frame_info.total_size;
if (total_size == 0) if (total_size == 0)
...@@ -1572,7 +1569,7 @@ m32r_output_function_epilogue (FILE * file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) ...@@ -1572,7 +1569,7 @@ m32r_output_function_epilogue (FILE * file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
sp_str, reg_names[PROLOGUE_TMP_REGNUM]); sp_str, reg_names[PROLOGUE_TMP_REGNUM]);
} }
else else
abort (); gcc_unreachable ();
if (current_frame_info.save_lr) if (current_frame_info.save_lr)
fprintf (file, "\tpop %s\n", reg_names[RETURN_ADDR_REGNUM]); fprintf (file, "\tpop %s\n", reg_names[RETURN_ADDR_REGNUM]);
...@@ -1654,10 +1651,8 @@ m32r_legitimize_pic_address (rtx orig, rtx reg) ...@@ -1654,10 +1651,8 @@ m32r_legitimize_pic_address (rtx orig, rtx reg)
if (reg == 0) if (reg == 0)
{ {
if (reload_in_progress || reload_completed) gcc_assert (!reload_in_progress && !reload_completed);
abort (); reg = gen_reg_rtx (Pmode);
else
reg = gen_reg_rtx (Pmode);
subregs = 1; subregs = 1;
} }
...@@ -1700,10 +1695,8 @@ m32r_legitimize_pic_address (rtx orig, rtx reg) ...@@ -1700,10 +1695,8 @@ m32r_legitimize_pic_address (rtx orig, rtx reg)
if (reg == 0) if (reg == 0)
{ {
if (reload_in_progress || reload_completed) gcc_assert (!reload_in_progress && !reload_completed);
abort (); reg = gen_reg_rtx (Pmode);
else
reg = gen_reg_rtx (Pmode);
} }
if (GET_CODE (XEXP (orig, 0)) == PLUS) if (GET_CODE (XEXP (orig, 0)) == PLUS)
...@@ -1721,11 +1714,11 @@ m32r_legitimize_pic_address (rtx orig, rtx reg) ...@@ -1721,11 +1714,11 @@ m32r_legitimize_pic_address (rtx orig, rtx reg)
{ {
if (INT16_P (INTVAL (offset))) if (INT16_P (INTVAL (offset)))
return plus_constant (base, INTVAL (offset)); return plus_constant (base, INTVAL (offset));
else if (! reload_in_progress && ! reload_completed)
offset = force_reg (Pmode, offset);
else else
/* If we reach here, then something is seriously wrong. */ {
abort (); gcc_assert (! reload_in_progress && ! reload_completed);
offset = force_reg (Pmode, offset);
}
} }
return gen_rtx_PLUS (Pmode, base, offset); return gen_rtx_PLUS (Pmode, base, offset);
...@@ -2045,9 +2038,7 @@ m32r_print_operand_address (FILE * file, rtx addr) ...@@ -2045,9 +2038,7 @@ m32r_print_operand_address (FILE * file, rtx addr)
} }
else if (GET_CODE (base) == LO_SUM) else if (GET_CODE (base) == LO_SUM)
{ {
if (index != 0 gcc_assert (!index && GET_CODE (XEXP (base, 0)) == REG);
|| GET_CODE (XEXP (base, 0)) != REG)
abort ();
if (small_data_operand (XEXP (base, 1), VOIDmode)) if (small_data_operand (XEXP (base, 1), VOIDmode))
fputs ("sda(", file); fputs ("sda(", file);
else else
...@@ -2117,12 +2108,9 @@ emit_cond_move (rtx * operands, rtx insn ATTRIBUTE_UNUSED) ...@@ -2117,12 +2108,9 @@ emit_cond_move (rtx * operands, rtx insn ATTRIBUTE_UNUSED)
buffer [0] = 0; buffer [0] = 0;
/* Destination must be a register. */ /* Destination must be a register. */
if (GET_CODE (operands [0]) != REG) gcc_assert (GET_CODE (operands [0]) == REG);
abort(); gcc_assert (conditional_move_operand (operands [2], SImode));
if (! conditional_move_operand (operands [2], SImode)) gcc_assert (conditional_move_operand (operands [3], SImode));
abort();
if (! conditional_move_operand (operands [3], SImode))
abort();
/* Check to see if the test is reversed. */ /* Check to see if the test is reversed. */
if (GET_CODE (operands [1]) == NE) if (GET_CODE (operands [1]) == NE)
...@@ -2181,7 +2169,7 @@ m32r_function_symbol (const char *name) ...@@ -2181,7 +2169,7 @@ m32r_function_symbol (const char *name)
else if (TARGET_MODEL_LARGE) else if (TARGET_MODEL_LARGE)
model = M32R_MODEL_LARGE; model = M32R_MODEL_LARGE;
else else
abort (); /* Shouldn't happen. */ gcc_unreachable (); /* Shouldn't happen. */
extra_flags |= model << SYMBOL_FLAG_MODEL_SHIFT; extra_flags |= model << SYMBOL_FLAG_MODEL_SHIFT;
if (extra_flags) if (extra_flags)
...@@ -2320,8 +2308,7 @@ m32r_output_block_move (rtx insn ATTRIBUTE_UNUSED, rtx operands[]) ...@@ -2320,8 +2308,7 @@ m32r_output_block_move (rtx insn ATTRIBUTE_UNUSED, rtx operands[])
int first_time; int first_time;
int got_extra = 0; int got_extra = 0;
if (bytes < 1 || bytes > MAX_MOVE_BYTES) gcc_assert (bytes >= 1 && bytes <= MAX_MOVE_BYTES);
abort ();
/* We do not have a post-increment store available, so the first set of /* We do not have a post-increment store available, so the first set of
stores are done without any increment, then the remaining ones can use stores are done without any increment, then the remaining ones can use
......
...@@ -907,7 +907,7 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER]; ...@@ -907,7 +907,7 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER];
else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \
(OFFSET) = size - current_function_pretend_args_size; \ (OFFSET) = size - current_function_pretend_args_size; \
else \ else \
abort (); \ gcc_unreachable (); \
} \ } \
while (0) while (0)
......
...@@ -410,7 +410,7 @@ ...@@ -410,7 +410,7 @@
return \"st %1,%0\"; return \"st %1,%0\";
} }
abort (); gcc_unreachable ();
}" }"
[(set_attr "type" "int2,int2,int4,int4,int4,multi,load2,load2,load4,store2,store2,store4") [(set_attr "type" "int2,int2,int4,int4,int4,multi,load2,load2,load4,store2,store2,store4")
(set_attr "length" "2,2,4,4,4,8,2,2,4,2,2,4")]) (set_attr "length" "2,2,4,4,4,8,2,2,4,2,2,4")])
...@@ -1515,7 +1515,7 @@ ...@@ -1515,7 +1515,7 @@
case LT : br = \"lt\"; invbr = \"ge\"; break; case LT : br = \"lt\"; invbr = \"ge\"; break;
case GE : br = \"ge\"; invbr = \"lt\"; break; case GE : br = \"ge\"; invbr = \"lt\"; break;
default: abort(); default: gcc_unreachable ();
} }
/* Is branch target reachable with bxxz? */ /* Is branch target reachable with bxxz? */
...@@ -1562,7 +1562,7 @@ ...@@ -1562,7 +1562,7 @@
case LT : br = \"lt\"; invbr = \"ge\"; break; case LT : br = \"lt\"; invbr = \"ge\"; break;
case GE : br = \"ge\"; invbr = \"lt\"; break; case GE : br = \"ge\"; invbr = \"lt\"; break;
default: abort(); default: gcc_unreachable ();
} }
/* Is branch target reachable with bxxz? */ /* Is branch target reachable with bxxz? */
......
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