Commit 6e1f65b5 by Nathan Sidwell Committed by Nathan Sidwell

mcore.c (mcore_print_operand_address): Use gcc_assert and gcc_unreachable as appropriate.

	* config/mcore/mcore.c (mcore_print_operand_address): Use
	gcc_assert and gcc_unreachable as appropriate.
	(mcore_print_operand, mcore_gen_compare_reg, mcore_output_call,
	mcore_output_andn, output_inline_const, mcore_output_move,
	mcore_output_movedouble, mcore_expand_block_move,
	layout_mcore_frame, mcore_initial_elimination_offset,
	mcore_expand_prolog, mcore_mark_dllexport,
	mcore_mark_dllimport): Likewise.
	* config/mcore/mcore.h (switch_to_section): Likewise.
	* config/mcore/mcore.md: Likewise.

From-SVN: r99315
parent 858081ad
2005-05-06 Nathan Sidwell <nathan@codesourcery.com>
* config/mcore/mcore.c (mcore_print_operand_address): Use
gcc_assert and gcc_unreachable as appropriate.
(mcore_print_operand, mcore_gen_compare_reg, mcore_output_call,
mcore_output_andn, output_inline_const, mcore_output_move,
mcore_output_movedouble, mcore_expand_block_move,
layout_mcore_frame, mcore_initial_elimination_offset,
mcore_expand_prolog, mcore_mark_dllexport,
mcore_mark_dllimport): Likewise.
* config/mcore/mcore.h (switch_to_section): Likewise.
* config/mcore/mcore.md: Likewise.
2005-05-06 Aldy Hernandez <aldyh@redhat.com> 2005-05-06 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/linux64.h: Remove MASK_PROFILE_KERNEL, and * config/rs6000/linux64.h: Remove MASK_PROFILE_KERNEL, and
......
...@@ -309,9 +309,7 @@ mcore_print_operand_address (FILE * stream, rtx x) ...@@ -309,9 +309,7 @@ mcore_print_operand_address (FILE * stream, rtx x)
break; break;
default: default:
debug_rtx (x); gcc_unreachable ();
abort ();
} }
} }
...@@ -370,7 +368,7 @@ mcore_print_operand (FILE * stream, rtx x, int code) ...@@ -370,7 +368,7 @@ mcore_print_operand (FILE * stream, rtx x, int code)
(stream, XEXP (adjust_address (x, SImode, 4), 0)); (stream, XEXP (adjust_address (x, SImode, 4), 0));
break; break;
default: default:
abort (); gcc_unreachable ();
} }
break; break;
case 'U': case 'U':
...@@ -598,18 +596,12 @@ mcore_gen_compare_reg (enum rtx_code code) ...@@ -598,18 +596,12 @@ mcore_gen_compare_reg (enum rtx_code code)
break; break;
case GTU: /* Use inverted condition, cmple. */ case GTU: /* Use inverted condition, cmple. */
if (GET_CODE (op1) == CONST_INT && INTVAL (op1) == 0) /* Unsigned > 0 is the same as != 0, but we need to invert the
{ condition, so we want to set code = EQ. This cannot be done
/* Unsigned > 0 is the same as != 0, but we need however, as the mcore does not support such a test. Instead
to invert the condition, so we want to set we cope with this case in the "bgtu" pattern itself so we
code = EQ. This cannot be done however, as the should never reach this point. */
mcore does not support such a test. Instead we gcc_assert (GET_CODE (op1) != CONST_INT || INTVAL (op1) != 0);
cope with this case in the "bgtu" pattern itself
so we should never reach this point. */
/* code = EQ; */
abort ();
break;
}
code = LEU; code = LEU;
/* Drop through. */ /* Drop through. */
...@@ -666,8 +658,7 @@ mcore_output_call (rtx operands[], int index) ...@@ -666,8 +658,7 @@ mcore_output_call (rtx operands[], int index)
{ {
if (TARGET_CG_DATA) if (TARGET_CG_DATA)
{ {
if (mcore_current_function_name == 0) gcc_assert (mcore_current_function_name);
abort ();
ASM_OUTPUT_CG_EDGE (asm_out_file, mcore_current_function_name, ASM_OUTPUT_CG_EDGE (asm_out_file, mcore_current_function_name,
"unknown", 1); "unknown", 1);
...@@ -679,13 +670,11 @@ mcore_output_call (rtx operands[], int index) ...@@ -679,13 +670,11 @@ mcore_output_call (rtx operands[], int index)
{ {
if (TARGET_CG_DATA) if (TARGET_CG_DATA)
{ {
if (mcore_current_function_name == 0) gcc_assert (mcore_current_function_name);
abort (); gcc_assert (GET_CODE (addr) == SYMBOL_REF);
if (GET_CODE (addr) != SYMBOL_REF)
abort ();
ASM_OUTPUT_CG_EDGE (asm_out_file, mcore_current_function_name, XSTR (addr, 0), 0); ASM_OUTPUT_CG_EDGE (asm_out_file, mcore_current_function_name,
XSTR (addr, 0), 0);
} }
sprintf (buffer, "jbsr\t%%%d", index); sprintf (buffer, "jbsr\t%%%d", index);
...@@ -1094,9 +1083,10 @@ mcore_output_andn (rtx insn ATTRIBUTE_UNUSED, rtx operands[]) ...@@ -1094,9 +1083,10 @@ mcore_output_andn (rtx insn ATTRIBUTE_UNUSED, rtx operands[])
rtx out_operands[3]; rtx out_operands[3];
const char * load_op; const char * load_op;
char buf[256]; char buf[256];
int trick_no;
if (try_constant_tricks (INTVAL (operands[1]), &x, &y) != 2) trick_no = try_constant_tricks (INTVAL (operands[1]), &x, &y);
abort (); gcc_assert (trick_no == 2);
out_operands[0] = operands[0]; out_operands[0] = operands[0];
out_operands[1] = GEN_INT(x); out_operands[1] = GEN_INT(x);
...@@ -1136,15 +1126,13 @@ output_inline_const (enum machine_mode mode, rtx operands[]) ...@@ -1136,15 +1126,13 @@ output_inline_const (enum machine_mode mode, rtx operands[])
int value; int value;
value = INTVAL (operands[1]); value = INTVAL (operands[1]);
if ((trick_no = try_constant_tricks (value, &x, &y)) == 0)
{
/* lrw's are handled separately: Large inlinable constants
never get turned into lrw's. Our caller uses try_constant_tricks
to back off to an lrw rather than calling this routine. */
abort ();
}
trick_no = try_constant_tricks (value, &x, &y);
/* lrw's are handled separately: Large inlinable constants never get
turned into lrw's. Our caller uses try_constant_tricks to back
off to an lrw rather than calling this routine. */
gcc_assert (trick_no != 0);
if (trick_no == 1) if (trick_no == 1)
x = value; x = value;
...@@ -1252,7 +1240,7 @@ mcore_output_move (rtx insn ATTRIBUTE_UNUSED, rtx operands[], ...@@ -1252,7 +1240,7 @@ mcore_output_move (rtx insn ATTRIBUTE_UNUSED, rtx operands[],
case QImode: case QImode:
return "ld.b\t%0,%1"; return "ld.b\t%0,%1";
default: default:
abort (); gcc_unreachable ();
} }
} }
else if (GET_CODE (src) == CONST_INT) else if (GET_CODE (src) == CONST_INT)
...@@ -1283,10 +1271,10 @@ mcore_output_move (rtx insn ATTRIBUTE_UNUSED, rtx operands[], ...@@ -1283,10 +1271,10 @@ mcore_output_move (rtx insn ATTRIBUTE_UNUSED, rtx operands[],
case QImode: case QImode:
return "st.b\t%1,%0"; return "st.b\t%1,%0";
default: default:
abort (); gcc_unreachable ();
} }
abort (); gcc_unreachable ();
} }
/* Return a sequence of instructions to perform DI or DF move. /* Return a sequence of instructions to perform DI or DF move.
...@@ -1329,10 +1317,10 @@ mcore_output_movedouble (rtx operands[], enum machine_mode mode ATTRIBUTE_UNUSED ...@@ -1329,10 +1317,10 @@ mcore_output_movedouble (rtx operands[], enum machine_mode mode ATTRIBUTE_UNUSED
else if (GET_CODE (XEXP (memexp, 1)) == REG) else if (GET_CODE (XEXP (memexp, 1)) == REG)
basereg = REGNO (XEXP (memexp, 1)); basereg = REGNO (XEXP (memexp, 1));
else else
abort (); gcc_unreachable ();
} }
else else
abort (); gcc_unreachable ();
/* ??? length attribute is wrong here. */ /* ??? length attribute is wrong here. */
if (dstreg == basereg) if (dstreg == basereg)
...@@ -1359,7 +1347,7 @@ mcore_output_movedouble (rtx operands[], enum machine_mode mode ATTRIBUTE_UNUSED ...@@ -1359,7 +1347,7 @@ mcore_output_movedouble (rtx operands[], enum machine_mode mode ATTRIBUTE_UNUSED
else if (CONST_OK_FOR_N (INTVAL (src))) else if (CONST_OK_FOR_N (INTVAL (src)))
output_asm_insn ("bmaski %0,%N1", operands); output_asm_insn ("bmaski %0,%N1", operands);
else else
abort (); gcc_unreachable ();
if (INTVAL (src) < 0) if (INTVAL (src) < 0)
return "bmaski %R0,32"; return "bmaski %R0,32";
...@@ -1377,7 +1365,7 @@ mcore_output_movedouble (rtx operands[], enum machine_mode mode ATTRIBUTE_UNUSED ...@@ -1377,7 +1365,7 @@ mcore_output_movedouble (rtx operands[], enum machine_mode mode ATTRIBUTE_UNUSED
else if (CONST_OK_FOR_N (INTVAL (src))) else if (CONST_OK_FOR_N (INTVAL (src)))
output_asm_insn ("bmaski %R0,%N1", operands); output_asm_insn ("bmaski %R0,%N1", operands);
else else
abort (); gcc_unreachable ();
if (INTVAL (src) < 0) if (INTVAL (src) < 0)
return "bmaski %0,32"; return "bmaski %0,32";
...@@ -1386,12 +1374,12 @@ mcore_output_movedouble (rtx operands[], enum machine_mode mode ATTRIBUTE_UNUSED ...@@ -1386,12 +1374,12 @@ mcore_output_movedouble (rtx operands[], enum machine_mode mode ATTRIBUTE_UNUSED
} }
} }
else else
abort (); gcc_unreachable ();
} }
else if (GET_CODE (dst) == MEM && GET_CODE (src) == REG) else if (GET_CODE (dst) == MEM && GET_CODE (src) == REG)
return "stw\t%1,%0\n\tstw\t%R1,%R0"; return "stw\t%1,%0\n\tstw\t%R1,%R0";
else else
abort (); gcc_unreachable ();
} }
/* Predicates used by the templates. */ /* Predicates used by the templates. */
...@@ -1624,7 +1612,7 @@ mcore_expand_block_move (rtx *operands) ...@@ -1624,7 +1612,7 @@ mcore_expand_block_move (rtx *operands)
max = 4*1; max = 4*1;
break; break;
default: default:
abort (); gcc_unreachable ();
} }
if (bytes <= max) if (bytes <= max)
...@@ -1859,14 +1847,7 @@ layout_mcore_frame (struct mcore_frame * infp) ...@@ -1859,14 +1847,7 @@ layout_mcore_frame (struct mcore_frame * infp)
assert (growths <= MAX_STACK_GROWS); assert (growths <= MAX_STACK_GROWS);
for (i = 0; i < growths; i++) for (i = 0; i < growths; i++)
{ gcc_assert (!(infp->growth[i] % STACK_BYTES));
if (infp->growth[i] % STACK_BYTES)
{
fprintf (stderr,"stack growth of %d is not %d aligned\n",
infp->growth[i], STACK_BYTES);
abort ();
}
}
} }
/* Define the offset between two registers, one to be eliminated, and /* Define the offset between two registers, one to be eliminated, and
...@@ -1895,9 +1876,7 @@ mcore_initial_elimination_offset (int from, int to) ...@@ -1895,9 +1876,7 @@ mcore_initial_elimination_offset (int from, int to)
if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM) if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
return below_frame; return below_frame;
abort (); gcc_unreachable ();
return 0;
} }
/* Keep track of some information about varargs for the prolog. */ /* Keep track of some information about varargs for the prolog. */
...@@ -1946,13 +1925,11 @@ mcore_expand_prolog (void) ...@@ -1946,13 +1925,11 @@ mcore_expand_prolog (void)
x = DECL_RTL (current_function_decl); x = DECL_RTL (current_function_decl);
if (GET_CODE (x) != MEM) gcc_assert (GET_CODE (x) == MEM);
abort ();
x = XEXP (x, 0); x = XEXP (x, 0);
if (GET_CODE (x) != SYMBOL_REF) gcc_assert (GET_CODE (x) == SYMBOL_REF);
abort ();
if (mcore_current_function_name) if (mcore_current_function_name)
free (mcore_current_function_name); free (mcore_current_function_name);
...@@ -2866,13 +2843,10 @@ mcore_mark_dllexport (tree decl) ...@@ -2866,13 +2843,10 @@ mcore_mark_dllexport (tree decl)
rtlname = XEXP (DECL_RTL (decl), 0); rtlname = XEXP (DECL_RTL (decl), 0);
if (GET_CODE (rtlname) == SYMBOL_REF) if (GET_CODE (rtlname) == MEM)
oldname = XSTR (rtlname, 0); rtlname = XEXP (rtlname, 0);
else if ( GET_CODE (rtlname) == MEM gcc_assert (GET_CODE (rtlname) == SYMBOL_REF);
&& GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) oldname = XSTR (rtlname, 0);
oldname = XSTR (XEXP (rtlname, 0), 0);
else
abort ();
if (mcore_dllexport_name_p (oldname)) if (mcore_dllexport_name_p (oldname))
return; /* Already done. */ return; /* Already done. */
...@@ -2904,17 +2878,13 @@ mcore_mark_dllimport (tree decl) ...@@ -2904,17 +2878,13 @@ mcore_mark_dllimport (tree decl)
rtlname = XEXP (DECL_RTL (decl), 0); rtlname = XEXP (DECL_RTL (decl), 0);
if (GET_CODE (rtlname) == SYMBOL_REF) if (GET_CODE (rtlname) == MEM)
oldname = XSTR (rtlname, 0); rtlname = XEXP (rtlname, 0);
else if ( GET_CODE (rtlname) == MEM gcc_assert (GET_CODE (rtlname) == SYMBOL_REF);
&& GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) oldname = XSTR (rtlname, 0);
oldname = XSTR (XEXP (rtlname, 0), 0);
else
abort ();
if (mcore_dllexport_name_p (oldname)) gcc_assert (!mcore_dllexport_name_p (oldname));
abort (); /* This shouldn't happen. */ if (mcore_dllimport_name_p (oldname))
else if (mcore_dllimport_name_p (oldname))
return; /* Already done. */ return; /* Already done. */
/* ??? One can well ask why we're making these checks here, /* ??? One can well ask why we're making these checks here,
......
...@@ -885,7 +885,7 @@ switch_to_section (enum in_section section, tree decl) \ ...@@ -885,7 +885,7 @@ switch_to_section (enum in_section section, tree decl) \
case in_data: data_section (); break; \ case in_data: data_section (); break; \
case in_named: named_section (decl, NULL, 0); break; \ case in_named: named_section (decl, NULL, 0); break; \
SUBTARGET_SWITCH_SECTIONS \ SUBTARGET_SWITCH_SECTIONS \
default: abort (); break; \ default: gcc_unreachable (); \
} \ } \
} }
......
...@@ -384,7 +384,7 @@ ...@@ -384,7 +384,7 @@
case 2: return \"and %0,%1\"; case 2: return \"and %0,%1\";
/* case -1: return \"bclri %0,%Q2\"; will not happen */ /* case -1: return \"bclri %0,%Q2\"; will not happen */
case 3: return mcore_output_bclri (operands[0], INTVAL (operands[2])); case 3: return mcore_output_bclri (operands[0], INTVAL (operands[2]));
default: abort (); default: gcc_unreachable ();
} }
}") }")
...@@ -404,7 +404,7 @@ ...@@ -404,7 +404,7 @@
case 1: return \"andi %0,%2\"; case 1: return \"andi %0,%2\";
case 2: return \"and %0,%1\"; case 2: return \"and %0,%1\";
case 3: return mcore_output_bclri (operands[0], INTVAL (operands[2])); case 3: return mcore_output_bclri (operands[0], INTVAL (operands[2]));
default: abort (); default: gcc_unreachable ();
} }
}") }")
...@@ -439,7 +439,7 @@ ...@@ -439,7 +439,7 @@
case 0: return \"or %0,%2\"; case 0: return \"or %0,%2\";
case 1: return \"bseti %0,%P2\"; case 1: return \"bseti %0,%P2\";
case 2: return mcore_output_bseti (operands[0], INTVAL (operands[2])); case 2: return mcore_output_bseti (operands[0], INTVAL (operands[2]));
default: abort (); default: gcc_unreachable ();
} }
}") }")
...@@ -455,7 +455,7 @@ ...@@ -455,7 +455,7 @@
case 0: return \"or %0,%2\"; case 0: return \"or %0,%2\";
case 1: return \"bseti %0,%P2\"; case 1: return \"bseti %0,%P2\";
case 2: return mcore_output_bseti (operands[0], INTVAL (operands[2])); case 2: return mcore_output_bseti (operands[0], INTVAL (operands[2]));
default: abort (); default: gcc_unreachable ();
} }
}") }")
...@@ -928,8 +928,7 @@ ...@@ -928,8 +928,7 @@
&& INTVAL (operands[2]) > 0 && ! (INTVAL (operands[2]) & 0x80000000)" && INTVAL (operands[2]) > 0 && ! (INTVAL (operands[2]) & 0x80000000)"
"* "*
{ {
if (GET_MODE (operands[2]) != SImode) gcc_assert (GET_MODE (operands[2]) == SImode);
abort ();
if (TARGET_LITTLE_END) if (TARGET_LITTLE_END)
return \"addu %0,%2\;cmphs %0,%2\;incf %R0\"; return \"addu %0,%2\;cmphs %0,%2\;incf %R0\";
return \"addu %R0,%2\;cmphs %R0,%2\;incf %0\"; return \"addu %R0,%2\;cmphs %R0,%2\;incf %0\";
...@@ -3072,7 +3071,7 @@ ...@@ -3072,7 +3071,7 @@
else if ((ofs = mcore_halfword_offset (INTVAL (operands[3]))) > -1) else if ((ofs = mcore_halfword_offset (INTVAL (operands[3]))) > -1)
mode = HImode; mode = HImode;
else else
abort (); gcc_unreachable ();
if (ofs > 0) if (ofs > 0)
operands[4] = gen_rtx_MEM (mode, operands[4] = gen_rtx_MEM (mode,
...@@ -3148,15 +3147,14 @@ ...@@ -3148,15 +3147,14 @@
return \"btsti %1,%2\\n\\tmovt %0,%4\"; return \"btsti %1,%2\\n\\tmovt %0,%4\";
} }
abort (); gcc_unreachable ();
} }
else if (GET_CODE (operands[3]) == CONST_INT else if (GET_CODE (operands[3]) == CONST_INT
&& INTVAL (operands[3]) == 0 && INTVAL (operands[3]) == 0
&& GET_CODE (operands[4]) == REG) && GET_CODE (operands[4]) == REG)
return \"btsti %1,%2\\n\\tclrt %0\"; return \"btsti %1,%2\\n\\tclrt %0\";
abort (); gcc_unreachable ();
return \"\";
}") }")
; experimental - do the constant folding ourselves. note that this isn't ; experimental - do the constant folding ourselves. note that this isn't
......
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