summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog15
-rw-r--r--gcc/config/xtensa/xtensa.c42
-rw-r--r--gcc/config/xtensa/xtensa.h17
-rw-r--r--gcc/config/xtensa/xtensa.md101
4 files changed, 91 insertions, 84 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 492dec371a2..fc060a723fc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,18 @@
+2005-04-29 Nathan Sidwell <nathan@codesourcery.com>
+
+ * config/xtensa/xtensa.c (gen_int_relational): Use gcc_assert and
+ gcc_unreachable as appropriate.
+ (gen_conditional_move, xtensa_split_operand_pair,
+ xtensa_split_operand_pair, xtensa_copy_incoming_a7,
+ xtensa_copy_incoming_a7, xtensa_copy_incoming_a7,
+ xtensa_copy_incoming_a7, xtensa_output_literal,
+ xtensa_output_literal, xtensa_output_literal): Likewise.
+ * config/xtensa/xtensa.h (INITIAL_ELIMINATION_OFFSET): Likewise.
+ * config/xtensa/xtensa.md (*btrue, *bfalse, *ubtrue, *ubfalse,
+ *bittrue, *bitfalse, *masktrue, *maskfalse, movsicc_internal0,
+ movsicc_internal1, movsfcc_internal0,
+ movsfcc_internal1): Likewise.
+
2005-04-28 James E Wilson <wilson@specifixinc.com>
* config/i386/i386.h (HI_REGISTER_NAMES): Fix typos in comment.
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 4e8e518e0a8..a45c886e3c1 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -667,8 +667,7 @@ gen_int_relational (enum rtx_code test_code, /* relational test (EQ, etc) */
struct cmp_info *p_info;
test = map_test_to_internal_test (test_code);
- if (test == ITEST_MAX)
- abort ();
+ gcc_assert (test != ITEST_MAX);
p_info = &info[ (int)test ];
@@ -864,7 +863,7 @@ gen_conditional_move (rtx cmp)
{
case LT: code = GE; break;
case GE: code = LT; break;
- default: abort ();
+ default: gcc_unreachable ();
}
}
@@ -956,7 +955,7 @@ xtensa_split_operand_pair (rtx operands[4], enum machine_mode mode)
break;
default:
- abort ();
+ gcc_unreachable ();
}
switch (GET_CODE (operands[0]))
@@ -972,7 +971,7 @@ xtensa_split_operand_pair (rtx operands[4], enum machine_mode mode)
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
@@ -1076,8 +1075,7 @@ xtensa_copy_incoming_a7 (rtx opnd)
return opnd;
/* This function should never be called again once a7 has been copied. */
- if (cfun->machine->set_frame_ptr_insn)
- abort ();
+ gcc_assert (!cfun->machine->set_frame_ptr_insn);
mode = GET_MODE (opnd);
@@ -1086,8 +1084,7 @@ xtensa_copy_incoming_a7 (rtx opnd)
reg = opnd;
if (GET_CODE (reg) == SUBREG)
{
- if (SUBREG_BYTE (reg) != 0)
- abort ();
+ gcc_assert (SUBREG_BYTE (reg) == 0);
reg = SUBREG_REG (reg);
}
if (GET_CODE (reg) != REG
@@ -1096,8 +1093,7 @@ xtensa_copy_incoming_a7 (rtx opnd)
return opnd;
/* 1-word args will always be in a7; 2-word args in a6/a7. */
- if (REGNO (reg) + HARD_REGNO_NREGS (A7_REG, mode) - 1 != A7_REG)
- abort ();
+ gcc_assert (REGNO (reg) + HARD_REGNO_NREGS (A7_REG, mode) - 1 == A7_REG);
cfun->machine->need_a7_copy = false;
@@ -1129,7 +1125,7 @@ xtensa_copy_incoming_a7 (rtx opnd)
emit_insn (gen_movqi_internal (tmp, gen_raw_REG (mode, A7_REG)));
break;
default:
- abort ();
+ gcc_unreachable ();
}
cfun->machine->set_frame_ptr_insn = emit_insn (gen_set_frame_ptr ());
@@ -1838,8 +1834,7 @@ xtensa_output_literal (FILE *file, rtx x, enum machine_mode mode, int labelno)
switch (GET_MODE_CLASS (mode))
{
case MODE_FLOAT:
- if (GET_CODE (x) != CONST_DOUBLE)
- abort ();
+ gcc_assert (GET_CODE (x) == CONST_DOUBLE);
REAL_VALUE_FROM_CONST_DOUBLE (r, x);
switch (mode)
@@ -1856,7 +1851,7 @@ xtensa_output_literal (FILE *file, rtx x, enum machine_mode mode, int labelno)
break;
default:
- abort ();
+ gcc_unreachable ();
}
break;
@@ -1864,24 +1859,27 @@ xtensa_output_literal (FILE *file, rtx x, enum machine_mode mode, int labelno)
case MODE_INT:
case MODE_PARTIAL_INT:
size = GET_MODE_SIZE (mode);
- if (size == 4)
+ switch (size)
{
+ case 4:
output_addr_const (file, x);
fputs ("\n", file);
- }
- else if (size == 8)
- {
+ break;
+
+ case 8:
output_addr_const (file, operand_subword (x, 0, 0, DImode));
fputs (", ", file);
output_addr_const (file, operand_subword (x, 1, 0, DImode));
fputs ("\n", file);
+ break;
+
+ default:
+ gcc_unreachable ();
}
- else
- abort ();
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index fc5351a92ec..9f2f7d63399 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -588,12 +588,17 @@ extern enum reg_class xtensa_char_to_class[256];
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
do { \
compute_frame_size (get_frame_size ()); \
- if ((FROM) == FRAME_POINTER_REGNUM) \
- (OFFSET) = 0; \
- else if ((FROM) == ARG_POINTER_REGNUM) \
- (OFFSET) = xtensa_current_frame_size; \
- else \
- abort (); \
+ switch (FROM) \
+ { \
+ case FRAME_POINTER_REGNUM: \
+ (OFFSET) = 0; \
+ break; \
+ case ARG_POINTER_REGNUM: \
+ (OFFSET) = xtensa_current_frame_size; \
+ break; \
+ default: \
+ gcc_unreachable (); \
+ } \
} while (0)
/* If defined, the maximum amount of space required for outgoing
diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
index 56388b5b8f0..cd08f7633a6 100644
--- a/gcc/config/xtensa/xtensa.md
+++ b/gcc/config/xtensa/xtensa.md
@@ -1326,7 +1326,7 @@
case NE: return "bne\t%0, %1, %2";
case LT: return "blt\t%0, %1, %2";
case GE: return "bge\t%0, %1, %2";
- default: break;
+ default: gcc_unreachable ();
}
}
else if (INTVAL (operands[1]) == 0)
@@ -1341,7 +1341,7 @@
: "bnez\t%0, %2");
case LT: return "bltz\t%0, %2";
case GE: return "bgez\t%0, %2";
- default: break;
+ default: gcc_unreachable ();
}
}
else
@@ -1352,11 +1352,10 @@
case NE: return "bnei\t%0, %d1, %2";
case LT: return "blti\t%0, %d1, %2";
case GE: return "bgei\t%0, %d1, %2";
- default: break;
+ default: gcc_unreachable ();
}
}
- abort ();
- return "";
+ gcc_unreachable ();
}
[(set_attr "type" "jump,jump")
(set_attr "mode" "none")
@@ -1379,7 +1378,7 @@
case NE: return "beq\t%0, %1, %2";
case LT: return "bge\t%0, %1, %2";
case GE: return "blt\t%0, %1, %2";
- default: break;
+ default: gcc_unreachable ();
}
}
else if (INTVAL (operands[1]) == 0)
@@ -1394,7 +1393,7 @@
: "beqz\t%0, %2");
case LT: return "bgez\t%0, %2";
case GE: return "bltz\t%0, %2";
- default: break;
+ default: gcc_unreachable ();
}
}
else
@@ -1405,11 +1404,10 @@
case NE: return "beqi\t%0, %d1, %2";
case LT: return "bgei\t%0, %d1, %2";
case GE: return "blti\t%0, %d1, %2";
- default: break;
+ default: gcc_unreachable ();
}
}
- abort ();
- return "";
+ gcc_unreachable ();
}
[(set_attr "type" "jump,jump")
(set_attr "mode" "none")
@@ -1430,7 +1428,7 @@
{
case LTU: return "bltu\t%0, %1, %2";
case GEU: return "bgeu\t%0, %1, %2";
- default: break;
+ default: gcc_unreachable ();
}
}
else
@@ -1439,11 +1437,10 @@
{
case LTU: return "bltui\t%0, %d1, %2";
case GEU: return "bgeui\t%0, %d1, %2";
- default: break;
+ default: gcc_unreachable ();
}
}
- abort ();
- return "";
+ gcc_unreachable ();
}
[(set_attr "type" "jump,jump")
(set_attr "mode" "none")
@@ -1464,7 +1461,7 @@
{
case LTU: return "bgeu\t%0, %1, %2";
case GEU: return "bltu\t%0, %1, %2";
- default: break;
+ default: gcc_unreachable ();
}
}
else
@@ -1473,11 +1470,10 @@
{
case LTU: return "bgeui\t%0, %d1, %2";
case GEU: return "bltui\t%0, %d1, %2";
- default: break;
+ default: gcc_unreachable ();
}
}
- abort ();
- return "";
+ gcc_unreachable ();
}
[(set_attr "type" "jump,jump")
(set_attr "mode" "none")
@@ -1505,7 +1501,7 @@
{
case EQ: return "bbci\t%0, %d1, %2";
case NE: return "bbsi\t%0, %d1, %2";
- default: break;
+ default: gcc_unreachable ();
}
}
else
@@ -1514,11 +1510,10 @@
{
case EQ: return "bbc\t%0, %1, %2";
case NE: return "bbs\t%0, %1, %2";
- default: break;
+ default: gcc_unreachable ();
}
}
- abort ();
- return "";
+ gcc_unreachable ();
}
[(set_attr "type" "jump")
(set_attr "mode" "none")
@@ -1544,7 +1539,7 @@
{
case EQ: return "bbsi\t%0, %d1, %2";
case NE: return "bbci\t%0, %d1, %2";
- default: break;
+ default: gcc_unreachable ();
}
}
else
@@ -1553,11 +1548,10 @@
{
case EQ: return "bbs\t%0, %1, %2";
case NE: return "bbc\t%0, %1, %2";
- default: break;
+ default: gcc_unreachable ();
}
}
- abort ();
- return "";
+ gcc_unreachable ();
}
[(set_attr "type" "jump")
(set_attr "mode" "none")
@@ -1577,10 +1571,8 @@
{
case EQ: return "bnone\t%0, %1, %2";
case NE: return "bany\t%0, %1, %2";
- default: break;
+ default: gcc_unreachable ();
}
- abort ();
- return "";
}
[(set_attr "type" "jump")
(set_attr "mode" "none")
@@ -1600,10 +1592,8 @@
{
case EQ: return "bany\t%0, %1, %2";
case NE: return "bnone\t%0, %1, %2";
- default: break;
+ default: gcc_unreachable ();
}
- abort ();
- return "";
}
[(set_attr "type" "jump")
(set_attr "mode" "none")
@@ -1758,7 +1748,7 @@
case NE: return "movnez\t%0, %2, %1";
case LT: return "movltz\t%0, %2, %1";
case GE: return "movgez\t%0, %2, %1";
- default: break;
+ default: gcc_unreachable ();
}
}
else
@@ -1769,11 +1759,10 @@
case NE: return "moveqz\t%0, %3, %1";
case LT: return "movgez\t%0, %3, %1";
case GE: return "movltz\t%0, %3, %1";
- default: break;
+ default: gcc_unreachable ();
}
}
- abort ();
- return "";
+ gcc_unreachable ();
}
[(set_attr "type" "move,move")
(set_attr "mode" "SI")
@@ -1797,9 +1786,9 @@
case 1:
if (isEq) return "movt\t%0, %3, %1";
return "movf\t%0, %3, %1";
+ default:
+ gcc_unreachable ();
}
- abort ();
- return "";
}
[(set_attr "type" "move,move")
(set_attr "mode" "SI")
@@ -1814,52 +1803,52 @@
(match_operand:SF 3 "register_operand" "0,r,0,f")))]
""
{
- if (which_alternative == 0)
+ switch (which_alternative)
{
+ case 0:
switch (GET_CODE (operands[4]))
{
case EQ: return "moveqz\t%0, %2, %1";
case NE: return "movnez\t%0, %2, %1";
case LT: return "movltz\t%0, %2, %1";
case GE: return "movgez\t%0, %2, %1";
- default: break;
+ default: gcc_unreachable ();
}
- }
- else if (which_alternative == 1)
- {
+ break;
+ case 1:
switch (GET_CODE (operands[4]))
{
case EQ: return "movnez\t%0, %3, %1";
case NE: return "moveqz\t%0, %3, %1";
case LT: return "movgez\t%0, %3, %1";
case GE: return "movltz\t%0, %3, %1";
- default: break;
+ default: gcc_unreachable ();
}
- }
- else if (which_alternative == 2)
- {
+ break;
+ case 2:
switch (GET_CODE (operands[4]))
{
case EQ: return "moveqz.s %0, %2, %1";
case NE: return "movnez.s %0, %2, %1";
case LT: return "movltz.s %0, %2, %1";
case GE: return "movgez.s %0, %2, %1";
- default: break;
+ default: gcc_unreachable ();
}
- }
- else if (which_alternative == 3)
- {
+ break;
+ case 3:
switch (GET_CODE (operands[4]))
{
case EQ: return "movnez.s %0, %3, %1";
case NE: return "moveqz.s %0, %3, %1";
case LT: return "movgez.s %0, %3, %1";
case GE: return "movltz.s %0, %3, %1";
- default: break;
+ default: gcc_unreachable ();
}
+ break;
+ default:
+ gcc_unreachable ();
}
- abort ();
- return "";
+ gcc_unreachable ();
}
[(set_attr "type" "move,move,move,move")
(set_attr "mode" "SF")
@@ -1889,9 +1878,9 @@
case 3:
if (isEq) return "movt.s\t%0, %3, %1";
return "movf.s\t%0, %3, %1";
+ default:
+ gcc_unreachable ();
}
- abort ();
- return "";
}
[(set_attr "type" "move,move,move,move")
(set_attr "mode" "SF")
OpenPOWER on IntegriCloud