Commit d35d9223 by Nathan Sidwell Committed by Nathan Sidwell

pdp11.c (pdp11_output_function_prologue): Use gcc_assert and gcc_unreachable as appropriate.

	* config/pdp11/pdp11.c (pdp11_output_function_prologue): Use
	gcc_assert and gcc_unreachable as appropriate.
	(pdp11_output_function_epilogue, output_move_double,
	output_move_quad, print_operand_address, output_jump,
	output_addr_const_pdp11): Likewise.
	* config/pdp11/pdp11.h (FUNCTION_PROFILER,
	ASM_OUTPUT_ALIGN): Likewise.
	* config/pdp11/pdp11.md: Likewise.
	(extendhisi2, subhi3, subqi3): Likewise.

From-SVN: r99446
parent 47d96c3e
2005-05-09 Nathan Sidwell <nathan@codesourcery.com>
* config/pdp11/pdp11.c (pdp11_output_function_prologue): Use
gcc_assert and gcc_unreachable as appropriate.
(pdp11_output_function_epilogue, output_move_double,
output_move_quad, print_operand_address, output_jump,
output_addr_const_pdp11): Likewise.
* config/pdp11/pdp11.h (FUNCTION_PROFILER,
ASM_OUTPUT_ALIGN): Likewise.
* config/pdp11/pdp11.md: Likewise.
(extendhisi2, subhi3, subqi3): Likewise.
2005-05-09 David Edelsohn <edelsohn@gnu.org> 2005-05-09 David Edelsohn <edelsohn@gnu.org>
PR middle-end/21237 PR middle-end/21237
......
...@@ -315,11 +315,10 @@ pdp11_output_function_prologue (FILE *stream, HOST_WIDE_INT size) ...@@ -315,11 +315,10 @@ pdp11_output_function_prologue (FILE *stream, HOST_WIDE_INT size)
&& regs_ever_live[regno] && regs_ever_live[regno]
&& ! call_used_regs[regno]) && ! call_used_regs[regno])
{ {
if (via_ac == -1) gcc_assert (via_ac != -1);
abort(); fprintf (stream, "\tldd %s, %s\n",
reg_names[regno], reg_names[via_ac]);
fprintf (stream, "\tldd %s, %s\n", reg_names[regno], reg_names[via_ac]); fprintf (stream, "\tstd %s, -(sp)\n", reg_names[via_ac]);
fprintf (stream, "\tstd %s, -(sp)\n", reg_names[via_ac]);
} }
} }
...@@ -410,8 +409,7 @@ pdp11_output_function_epilogue (FILE *stream, HOST_WIDE_INT size) ...@@ -410,8 +409,7 @@ pdp11_output_function_epilogue (FILE *stream, HOST_WIDE_INT size)
&& regs_ever_live[i] && regs_ever_live[i]
&& ! call_used_regs[i]) && ! call_used_regs[i])
{ {
if (! LOAD_FPU_REG_P(via_ac)) gcc_assert (LOAD_FPU_REG_P(via_ac));
abort();
fprintf(stream, "\tldd %#o(r5), %s\n", (-fsize-k)&0xffff, reg_names[via_ac]); fprintf(stream, "\tldd %#o(r5), %s\n", (-fsize-k)&0xffff, reg_names[via_ac]);
fprintf(stream, "\tstd %s, %s\n", reg_names[via_ac], reg_names[i]); fprintf(stream, "\tstd %s, %s\n", reg_names[via_ac], reg_names[i]);
...@@ -442,8 +440,7 @@ pdp11_output_function_epilogue (FILE *stream, HOST_WIDE_INT size) ...@@ -442,8 +440,7 @@ pdp11_output_function_epilogue (FILE *stream, HOST_WIDE_INT size)
&& regs_ever_live[i] && regs_ever_live[i]
&& ! call_used_regs[i]) && ! call_used_regs[i])
{ {
if (! LOAD_FPU_REG_P(via_ac)) gcc_assert (LOAD_FPU_REG_P(via_ac));
abort();
fprintf(stream, "\tldd (sp)+, %s\n", reg_names[via_ac]); fprintf(stream, "\tldd (sp)+, %s\n", reg_names[via_ac]);
fprintf(stream, "\tstd %s, %s\n", reg_names[via_ac], reg_names[i]); fprintf(stream, "\tstd %s, %s\n", reg_names[via_ac], reg_names[i]);
...@@ -524,8 +521,7 @@ output_move_double (rtx *operands) ...@@ -524,8 +521,7 @@ output_move_double (rtx *operands)
supposed to allow to happen. Abort if we get one, supposed to allow to happen. Abort if we get one,
because generating code for these cases is painful. */ because generating code for these cases is painful. */
if (optype0 == RNDOP || optype1 == RNDOP) gcc_assert (optype0 != RNDOP && optype1 != RNDOP);
abort ();
/* If one operand is decrementing and one is incrementing /* If one operand is decrementing and one is incrementing
decrement the former register explicitly decrement the former register explicitly
...@@ -585,11 +581,9 @@ output_move_double (rtx *operands) ...@@ -585,11 +581,9 @@ output_move_double (rtx *operands)
latehalf[1] = GEN_INT (INTVAL(operands[1]) >> 16); latehalf[1] = GEN_INT (INTVAL(operands[1]) >> 16);
operands[1] = GEN_INT (INTVAL(operands[1]) & 0xff); operands[1] = GEN_INT (INTVAL(operands[1]) & 0xff);
} }
else if (GET_CODE (operands[1]) == CONST_DOUBLE) else
{ /* immediate 32 bit values not allowed */
/* immediate 32 bit values not allowed */ gcc_assert (GET_CODE (operands[1]) != CONST_DOUBLE);
abort();
}
} }
else else
latehalf[1] = operands[1]; latehalf[1] = operands[1];
...@@ -699,15 +693,13 @@ output_move_quad (rtx *operands) ...@@ -699,15 +693,13 @@ output_move_quad (rtx *operands)
supposed to allow to happen. Abort if we get one, supposed to allow to happen. Abort if we get one,
because generating code for these cases is painful. */ because generating code for these cases is painful. */
if (optype0 == RNDOP || optype1 == RNDOP) gcc_assert (optype0 != RNDOP && optype1 != RNDOP);
abort ();
/* check if we move a CPU reg to an FPU reg, or vice versa! */ /* check if we move a CPU reg to an FPU reg, or vice versa! */
if (optype0 == REGOP && optype1 == REGOP) if (optype0 == REGOP && optype1 == REGOP)
/* bogus - 64 bit cannot reside in CPU! */ /* bogus - 64 bit cannot reside in CPU! */
if (CPU_REG_P(REGNO(operands[0])) gcc_assert (!CPU_REG_P(REGNO(operands[0]))
|| CPU_REG_P (REGNO(operands[1]))) && !CPU_REG_P (REGNO(operands[1])));
abort();
if (optype0 == REGOP || optype1 == REGOP) if (optype0 == REGOP || optype1 == REGOP)
{ {
...@@ -801,7 +793,7 @@ output_move_quad (rtx *operands) ...@@ -801,7 +793,7 @@ output_move_quad (rtx *operands)
latehalf[1] = const0_rtx; latehalf[1] = const0_rtx;
} }
else else
abort(); gcc_unreachable ();
} }
else else
latehalf[1] = operands[1]; latehalf[1] = operands[1];
...@@ -995,7 +987,7 @@ print_operand_address (FILE *file, register rtx addr) ...@@ -995,7 +987,7 @@ print_operand_address (FILE *file, register rtx addr)
} }
if (offset != 0) if (offset != 0)
{ {
if (addr != 0) abort (); gcc_assert (addr == 0);
addr = offset; addr = offset;
} }
if (reg1 != 0 && GET_CODE (reg1) == MULT) if (reg1 != 0 && GET_CODE (reg1) == MULT)
...@@ -1022,17 +1014,15 @@ print_operand_address (FILE *file, register rtx addr) ...@@ -1022,17 +1014,15 @@ print_operand_address (FILE *file, register rtx addr)
output_address (addr); output_address (addr);
if (breg != 0) if (breg != 0)
{ {
if (GET_CODE (breg) != REG) gcc_assert (GET_CODE (breg) == REG);
abort ();
fprintf (file, "(%s)", reg_names[REGNO (breg)]); fprintf (file, "(%s)", reg_names[REGNO (breg)]);
} }
if (ireg != 0) if (ireg != 0)
{ {
if (GET_CODE (ireg) == MULT) if (GET_CODE (ireg) == MULT)
ireg = XEXP (ireg, 0); ireg = XEXP (ireg, 0);
if (GET_CODE (ireg) != REG) gcc_assert (GET_CODE (ireg) == REG);
abort (); gcc_unreachable(); /* ??? */
abort();
fprintf (file, "[%s]", reg_names[REGNO (ireg)]); fprintf (file, "[%s]", reg_names[REGNO (ireg)]);
} }
break; break;
...@@ -1203,7 +1193,7 @@ pdp11_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total) ...@@ -1203,7 +1193,7 @@ pdp11_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total)
} }
const char * const char *
output_jump(const char *pos, const char *neg, int length) output_jump (const char *pos, const char *neg, int length)
{ {
static int x = 0; static int x = 0;
...@@ -1238,7 +1228,7 @@ output_jump(const char *pos, const char *neg, int length) ...@@ -1238,7 +1228,7 @@ output_jump(const char *pos, const char *neg, int length)
default: default:
abort(); gcc_unreachable ();
} }
} }
...@@ -1667,10 +1657,8 @@ output_addr_const_pdp11 (FILE *file, rtx x) ...@@ -1667,10 +1657,8 @@ output_addr_const_pdp11 (FILE *file, rtx x)
switch (GET_CODE (x)) switch (GET_CODE (x))
{ {
case PC: case PC:
if (flag_pic) gcc_assert (flag_pic);
putc ('.', file); putc ('.', file);
else
abort ();
break; break;
case SYMBOL_REF: case SYMBOL_REF:
...@@ -1703,10 +1691,8 @@ output_addr_const_pdp11 (FILE *file, rtx x) ...@@ -1703,10 +1691,8 @@ output_addr_const_pdp11 (FILE *file, rtx x)
if (GET_MODE (x) == VOIDmode) if (GET_MODE (x) == VOIDmode)
{ {
/* We can use %o if the number is one word and positive. */ /* We can use %o if the number is one word and positive. */
if (CONST_DOUBLE_HIGH (x)) gcc_assert (!CONST_DOUBLE_HIGH (x));
abort (); /* Should we just silently drop the high part? */ fprintf (file, "%#ho", (unsigned short) CONST_DOUBLE_LOW (x));
else
fprintf (file, "%#ho", (unsigned short) CONST_DOUBLE_LOW (x));
} }
else else
/* We can't handle floating point constants; /* We can't handle floating point constants;
......
...@@ -550,7 +550,7 @@ maybe ac0 ? - as option someday! */ ...@@ -550,7 +550,7 @@ maybe ac0 ? - as option someday! */
for profiling a function entry. */ for profiling a function entry. */
#define FUNCTION_PROFILER(FILE, LABELNO) \ #define FUNCTION_PROFILER(FILE, LABELNO) \
abort (); gcc_unreachable ();
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
the stack pointer does not matter. The value is tested only in the stack pointer does not matter. The value is tested only in
...@@ -944,7 +944,7 @@ extern struct rtx_def *cc0_reg_rtx; ...@@ -944,7 +944,7 @@ extern struct rtx_def *cc0_reg_rtx;
fprintf (FILE, "\t.even\n"); \ fprintf (FILE, "\t.even\n"); \
break; \ break; \
default: \ default: \
abort (); \ gcc_unreachable (); \
} }
#define ASM_OUTPUT_SKIP(FILE,SIZE) \ #define ASM_OUTPUT_SKIP(FILE,SIZE) \
...@@ -1016,8 +1016,7 @@ JMP FUNCTION 0x0058 0x0000 <- FUNCTION ...@@ -1016,8 +1016,7 @@ JMP FUNCTION 0x0058 0x0000 <- FUNCTION
#define TRAMPOLINE_TEMPLATE(FILE) \ #define TRAMPOLINE_TEMPLATE(FILE) \
{ \ { \
if (TARGET_SPLIT) \ gcc_assert (!TARGET_SPLIT); \
abort(); \
\ \
assemble_aligned_integer (2, GEN_INT (0x9400+STATIC_CHAIN_REGNUM)); \ assemble_aligned_integer (2, GEN_INT (0x9400+STATIC_CHAIN_REGNUM)); \
assemble_aligned_integer (2, const0_rtx); \ assemble_aligned_integer (2, const0_rtx); \
...@@ -1034,8 +1033,7 @@ JMP FUNCTION 0x0058 0x0000 <- FUNCTION ...@@ -1034,8 +1033,7 @@ JMP FUNCTION 0x0058 0x0000 <- FUNCTION
#define INITIALIZE_TRAMPOLINE(TRAMP,FNADDR,CXT) \ #define INITIALIZE_TRAMPOLINE(TRAMP,FNADDR,CXT) \
{ \ { \
if (TARGET_SPLIT) \ gcc_assert (!TARGET_SPLIT); \
abort(); \
\ \
emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 2)), CXT); \ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 2)), CXT); \
emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 6)), FNADDR); \ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 6)), FNADDR); \
......
...@@ -124,8 +124,7 @@ ...@@ -124,8 +124,7 @@
rtx br_insn = NEXT_INSN (insn); rtx br_insn = NEXT_INSN (insn);
RTX_CODE br_code; RTX_CODE br_code;
if (GET_CODE (br_insn) != JUMP_INSN) gcc_assert (GET_CODE (br_insn) == JUMP_INSN);
abort();
br_code = GET_CODE (XEXP (XEXP (PATTERN (br_insn), 1), 0)); br_code = GET_CODE (XEXP (XEXP (PATTERN (br_insn), 1), 0));
switch(br_code) switch(br_code)
...@@ -148,7 +147,7 @@ ...@@ -148,7 +147,7 @@
default: default:
abort(); gcc_unreachable ();
} }
}" }"
[(set_attr "length" "4")]) [(set_attr "length" "4")])
...@@ -872,7 +871,7 @@ ...@@ -872,7 +871,7 @@
default: default:
abort(); gcc_unreachable ();
} }
}" }"
[(set_attr "length" "5,3,3")]) [(set_attr "length" "5,3,3")])
...@@ -1131,8 +1130,7 @@ ...@@ -1131,8 +1130,7 @@
"" ""
"* "*
{ {
if (GET_CODE (operands[2]) == CONST_INT) gcc_assert (GET_CODE (operands[2]) != CONST_INT);
abort();
return \"sub %2, %0\"; return \"sub %2, %0\";
}" }"
...@@ -1145,8 +1143,7 @@ ...@@ -1145,8 +1143,7 @@
"" ""
"* "*
{ {
if (GET_CODE (operands[2]) == CONST_INT) gcc_assert (GET_CODE (operands[2]) != CONST_INT);
abort();
return \"sub %2, %0\"; return \"sub %2, %0\";
}" }"
......
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