diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-09 15:58:56 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-09 15:58:56 +0000 |
commit | 96638b8a91f2a04f97ba11e07a161d9bce275d9c (patch) | |
tree | ec7afc29607b68bc05bb68569514abdc99ff8249 /gcc | |
parent | 295610ef2212ab4bf1b1335f187db20e51daac42 (diff) | |
download | gcc-96638b8a91f2a04f97ba11e07a161d9bce275d9c.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99446 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/config/pdp11/pdp11.c | 62 | ||||
-rw-r--r-- | gcc/config/pdp11/pdp11.h | 10 | ||||
-rw-r--r-- | gcc/config/pdp11/pdp11.md | 13 |
4 files changed, 45 insertions, 52 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b933880feed..fa94448707a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +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> PR middle-end/21237 diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c index 8a0df37e13d..f9fbfcf6749 100644 --- a/gcc/config/pdp11/pdp11.c +++ b/gcc/config/pdp11/pdp11.c @@ -315,11 +315,10 @@ pdp11_output_function_prologue (FILE *stream, HOST_WIDE_INT size) && regs_ever_live[regno] && ! call_used_regs[regno]) { - if (via_ac == -1) - abort(); - - fprintf (stream, "\tldd %s, %s\n", reg_names[regno], reg_names[via_ac]); - fprintf (stream, "\tstd %s, -(sp)\n", reg_names[via_ac]); + gcc_assert (via_ac != -1); + fprintf (stream, "\tldd %s, %s\n", + reg_names[regno], 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) && regs_ever_live[i] && ! call_used_regs[i]) { - if (! LOAD_FPU_REG_P(via_ac)) - abort(); + gcc_assert (LOAD_FPU_REG_P(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]); @@ -442,8 +440,7 @@ pdp11_output_function_epilogue (FILE *stream, HOST_WIDE_INT size) && regs_ever_live[i] && ! call_used_regs[i]) { - if (! LOAD_FPU_REG_P(via_ac)) - abort(); + gcc_assert (LOAD_FPU_REG_P(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]); @@ -524,8 +521,7 @@ output_move_double (rtx *operands) supposed to allow to happen. Abort if we get one, because generating code for these cases is painful. */ - if (optype0 == RNDOP || optype1 == RNDOP) - abort (); + gcc_assert (optype0 != RNDOP && optype1 != RNDOP); /* If one operand is decrementing and one is incrementing decrement the former register explicitly @@ -585,11 +581,9 @@ output_move_double (rtx *operands) latehalf[1] = GEN_INT (INTVAL(operands[1]) >> 16); operands[1] = GEN_INT (INTVAL(operands[1]) & 0xff); } - else if (GET_CODE (operands[1]) == CONST_DOUBLE) - { - /* immediate 32 bit values not allowed */ - abort(); - } + else + /* immediate 32 bit values not allowed */ + gcc_assert (GET_CODE (operands[1]) != CONST_DOUBLE); } else latehalf[1] = operands[1]; @@ -699,15 +693,13 @@ output_move_quad (rtx *operands) supposed to allow to happen. Abort if we get one, because generating code for these cases is painful. */ - if (optype0 == RNDOP || optype1 == RNDOP) - abort (); + gcc_assert (optype0 != RNDOP && optype1 != RNDOP); /* check if we move a CPU reg to an FPU reg, or vice versa! */ if (optype0 == REGOP && optype1 == REGOP) /* bogus - 64 bit cannot reside in CPU! */ - if (CPU_REG_P(REGNO(operands[0])) - || CPU_REG_P (REGNO(operands[1]))) - abort(); + gcc_assert (!CPU_REG_P(REGNO(operands[0])) + && !CPU_REG_P (REGNO(operands[1]))); if (optype0 == REGOP || optype1 == REGOP) { @@ -801,7 +793,7 @@ output_move_quad (rtx *operands) latehalf[1] = const0_rtx; } else - abort(); + gcc_unreachable (); } else latehalf[1] = operands[1]; @@ -995,7 +987,7 @@ print_operand_address (FILE *file, register rtx addr) } if (offset != 0) { - if (addr != 0) abort (); + gcc_assert (addr == 0); addr = offset; } if (reg1 != 0 && GET_CODE (reg1) == MULT) @@ -1022,17 +1014,15 @@ print_operand_address (FILE *file, register rtx addr) output_address (addr); if (breg != 0) { - if (GET_CODE (breg) != REG) - abort (); + gcc_assert (GET_CODE (breg) == REG); fprintf (file, "(%s)", reg_names[REGNO (breg)]); } if (ireg != 0) { if (GET_CODE (ireg) == MULT) ireg = XEXP (ireg, 0); - if (GET_CODE (ireg) != REG) - abort (); - abort(); + gcc_assert (GET_CODE (ireg) == REG); + gcc_unreachable(); /* ??? */ fprintf (file, "[%s]", reg_names[REGNO (ireg)]); } break; @@ -1203,7 +1193,7 @@ pdp11_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total) } 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; @@ -1238,7 +1228,7 @@ output_jump(const char *pos, const char *neg, int length) default: - abort(); + gcc_unreachable (); } } @@ -1667,10 +1657,8 @@ output_addr_const_pdp11 (FILE *file, rtx x) switch (GET_CODE (x)) { case PC: - if (flag_pic) - putc ('.', file); - else - abort (); + gcc_assert (flag_pic); + putc ('.', file); break; case SYMBOL_REF: @@ -1703,10 +1691,8 @@ output_addr_const_pdp11 (FILE *file, rtx x) if (GET_MODE (x) == VOIDmode) { /* We can use %o if the number is one word and positive. */ - if (CONST_DOUBLE_HIGH (x)) - abort (); /* Should we just silently drop the high part? */ - else - fprintf (file, "%#ho", (unsigned short) CONST_DOUBLE_LOW (x)); + gcc_assert (!CONST_DOUBLE_HIGH (x)); + fprintf (file, "%#ho", (unsigned short) CONST_DOUBLE_LOW (x)); } else /* We can't handle floating point constants; diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h index d8d5c50431e..1391bbe0016 100644 --- a/gcc/config/pdp11/pdp11.h +++ b/gcc/config/pdp11/pdp11.h @@ -550,7 +550,7 @@ maybe ac0 ? - as option someday! */ for profiling a function entry. */ #define FUNCTION_PROFILER(FILE, LABELNO) \ - abort (); + gcc_unreachable (); /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, the stack pointer does not matter. The value is tested only in @@ -944,7 +944,7 @@ extern struct rtx_def *cc0_reg_rtx; fprintf (FILE, "\t.even\n"); \ break; \ default: \ - abort (); \ + gcc_unreachable (); \ } #define ASM_OUTPUT_SKIP(FILE,SIZE) \ @@ -1016,8 +1016,7 @@ JMP FUNCTION 0x0058 0x0000 <- FUNCTION #define TRAMPOLINE_TEMPLATE(FILE) \ { \ - if (TARGET_SPLIT) \ - abort(); \ + gcc_assert (!TARGET_SPLIT); \ \ assemble_aligned_integer (2, GEN_INT (0x9400+STATIC_CHAIN_REGNUM)); \ assemble_aligned_integer (2, const0_rtx); \ @@ -1034,8 +1033,7 @@ JMP FUNCTION 0x0058 0x0000 <- FUNCTION #define INITIALIZE_TRAMPOLINE(TRAMP,FNADDR,CXT) \ { \ - if (TARGET_SPLIT) \ - abort(); \ + gcc_assert (!TARGET_SPLIT); \ \ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 2)), CXT); \ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 6)), FNADDR); \ diff --git a/gcc/config/pdp11/pdp11.md b/gcc/config/pdp11/pdp11.md index 52d3937a39c..ebf486352fb 100644 --- a/gcc/config/pdp11/pdp11.md +++ b/gcc/config/pdp11/pdp11.md @@ -124,8 +124,7 @@ rtx br_insn = NEXT_INSN (insn); RTX_CODE br_code; - if (GET_CODE (br_insn) != JUMP_INSN) - abort(); + gcc_assert (GET_CODE (br_insn) == JUMP_INSN); br_code = GET_CODE (XEXP (XEXP (PATTERN (br_insn), 1), 0)); switch(br_code) @@ -148,7 +147,7 @@ default: - abort(); + gcc_unreachable (); } }" [(set_attr "length" "4")]) @@ -872,7 +871,7 @@ default: - abort(); + gcc_unreachable (); } }" [(set_attr "length" "5,3,3")]) @@ -1131,8 +1130,7 @@ "" "* { - if (GET_CODE (operands[2]) == CONST_INT) - abort(); + gcc_assert (GET_CODE (operands[2]) != CONST_INT); return \"sub %2, %0\"; }" @@ -1145,8 +1143,7 @@ "" "* { - if (GET_CODE (operands[2]) == CONST_INT) - abort(); + gcc_assert (GET_CODE (operands[2]) != CONST_INT); return \"sub %2, %0\"; }" |