diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2005-05-14 18:08:20 +0000 |
---|---|---|
committer | John David Anglin <danglin@gcc.gnu.org> | 2005-05-14 18:08:20 +0000 |
commit | 90285d8d96e6a2c348691f35fe37e936f64eeb01 (patch) | |
tree | 8bad8112a886f52c636ec98bdf561b07b231fc5f | |
parent | 0f8def688dde484c63a3d5271d10b2c0bfbd2c0e (diff) | |
download | gcc-90285d8d96e6a2c348691f35fe37e936f64eeb01.zip gcc-90285d8d96e6a2c348691f35fe37e936f64eeb01.tar.gz gcc-90285d8d96e6a2c348691f35fe37e936f64eeb01.tar.bz2 |
vax.c: (print_operand_address) Use gcc_unreachable() and gcc_assert().
* 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.
Co-Authored-By: Jan-Benedict Glaw <jbglaw@lug-owl.de>
From-SVN: r99703
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/config/vax/vax.c | 50 | ||||
-rw-r--r-- | gcc/config/vax/vax.md | 6 |
3 files changed, 34 insertions, 31 deletions
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 <nathan@codesourcery.com> + Jan-Benedict Glaw <jbglaw@lug-owl.de> + + * 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 <jbglaw@lug-owl.de> * 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 |