From: danglin Date: Sat, 14 May 2005 18:08:20 +0000 (+0000) Subject: * config/vax/vax.c: (print_operand_address) Use gcc_unreachable() and X-Git-Tag: upstream/4.9.2~61205 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ae3de6880a4271ed20ff42b18fbc22379633308;p=platform%2Fupstream%2Flinaro-gcc.git * config/vax/vax.c: (print_operand_address) Use gcc_unreachable() and gcc_assert(). (rev_cond_name) Likewise. (vax_float_literal) Likewise. * config/vax/vax.md: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99703 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9140818..84e1796 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2005-05-14 Nathan Sidwell + Jan-Benedict Glaw + + * config/vax/vax.c: (print_operand_address) Use gcc_unreachable() and + gcc_assert(). + (rev_cond_name) Likewise. + (vax_float_literal) Likewise. + * config/vax/vax.md: Likewise. + 2005-05-14 Jan-Benedict Glaw * config/vax/vax.md: define_constant VAXens AP, FP, SP and PC diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index 81e6e28..75892f2 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -269,7 +269,7 @@ print_operand_address (FILE * file, rtx addr) addr = XEXP (addr, 1); } else - abort (); + gcc_unreachable (); if (GET_CODE (addr) == REG) { @@ -280,8 +280,9 @@ print_operand_address (FILE * file, rtx addr) } else if (GET_CODE (addr) == MULT) ireg = addr; - else if (GET_CODE (addr) == PLUS) + else { + gcc_assert (GET_CODE (addr) == PLUS); if (CONSTANT_ADDRESS_P (XEXP (addr, 0)) || GET_CODE (XEXP (addr, 0)) == MEM) { @@ -289,10 +290,11 @@ print_operand_address (FILE * file, rtx addr) { if (GET_CODE (offset) == CONST_INT) offset = plus_constant (XEXP (addr, 0), INTVAL (offset)); - else if (GET_CODE (XEXP (addr, 0)) == CONST_INT) - offset = plus_constant (offset, INTVAL (XEXP (addr, 0))); else - abort (); + { + gcc_assert (GET_CODE (XEXP (addr, 0)) == CONST_INT); + offset = plus_constant (offset, INTVAL (XEXP (addr, 0))); + } } offset = XEXP (addr, 0); } @@ -303,14 +305,12 @@ print_operand_address (FILE * file, rtx addr) else reg1 = XEXP (addr, 0); } - else if (GET_CODE (XEXP (addr, 0)) == MULT) + else { - if (ireg) - abort (); + gcc_assert (GET_CODE (XEXP (addr, 0)) == MULT); + gcc_assert (!ireg); ireg = XEXP (addr, 0); } - else - abort (); if (CONSTANT_ADDRESS_P (XEXP (addr, 1)) || GET_CODE (XEXP (addr, 1)) == MEM) @@ -319,10 +319,11 @@ print_operand_address (FILE * file, rtx addr) { if (GET_CODE (offset) == CONST_INT) offset = plus_constant (XEXP (addr, 1), INTVAL (offset)); - else if (GET_CODE (XEXP (addr, 1)) == CONST_INT) - offset = plus_constant (offset, INTVAL (XEXP (addr, 1))); else - abort (); + { + gcc_assert (GET_CODE (XEXP (addr, 1)) == CONST_INT); + offset = plus_constant (offset, INTVAL (XEXP (addr, 1))); + } } offset = XEXP (addr, 1); } @@ -333,25 +334,20 @@ print_operand_address (FILE * file, rtx addr) else reg1 = XEXP (addr, 1); } - else if (GET_CODE (XEXP (addr, 1)) == MULT) + else { - if (ireg) - abort (); + gcc_assert (GET_CODE (XEXP (addr, 1)) == MULT); + gcc_assert (!ireg); ireg = XEXP (addr, 1); } - else - abort (); } - else - abort (); /* If REG1 is nonzero, figure out if it is a base or index register. */ if (reg1) { if (breg != 0 || (offset && GET_CODE (offset) == MEM)) { - if (ireg) - abort (); + gcc_assert (!ireg); ireg = reg1; } else @@ -368,8 +364,7 @@ print_operand_address (FILE * file, rtx addr) { if (GET_CODE (ireg) == MULT) ireg = XEXP (ireg, 0); - if (GET_CODE (ireg) != REG) - abort (); + gcc_assert (GET_CODE (ireg) == REG); fprintf (file, "[%s]", reg_names[REGNO (ireg)]); } break; @@ -406,7 +401,7 @@ rev_cond_name (rtx op) return "lssu"; default: - abort (); + gcc_unreachable (); } } @@ -432,12 +427,13 @@ vax_float_literal(rtx c) for (i = 0; i < 7; i++) { int x = 1 << i; + bool ok; REAL_VALUE_FROM_INT (s, x, 0, mode); if (REAL_VALUES_EQUAL (r, s)) return 1; - if (!exact_real_inverse (mode, &s)) - abort (); + ok = exact_real_inverse (mode, &s); + gcc_assert (ok); if (REAL_VALUES_EQUAL (r, s)) return 1; } diff --git a/gcc/config/vax/vax.md b/gcc/config/vax/vax.md index a77f841..6d447f7 100644 --- a/gcc/config/vax/vax.md +++ b/gcc/config/vax/vax.md @@ -1205,8 +1205,7 @@ (match_operand:SI 3 "immediate_operand" "")))])] "" { - if (INTVAL (operands[3]) > 255 * 4 || INTVAL (operands[3]) % 4) - abort (); + gcc_assert (INTVAL (operands[3]) <= 255 * 4 && INTVAL (operands[3]) % 4 == 0); /* Operand 1 is the number of bytes to be popped by DW_CFA_GNU_args_size during EH unwinding. We must include the argument count pushed by @@ -1234,8 +1233,7 @@ (match_operand:SI 4 "immediate_operand" "")))])] "" { - if (INTVAL (operands[4]) > 255 * 4 || INTVAL (operands[4]) % 4) - abort (); + gcc_assert (INTVAL (operands[4]) <= 255 * 4 && INTVAL (operands[4]) % 4 == 0); /* Operand 2 is the number of bytes to be popped by DW_CFA_GNU_args_size during EH unwinding. We must include the argument count pushed by