This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
assertify mn10300
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Alexandre Oliva <aoliva at redhat dot com>
- Date: Fri, 06 May 2005 16:30:52 +0100
- Subject: assertify mn10300
This patch assertifies the mn10300 target. tested with an i686 hosted
cross tools and simulated thereon. ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2005-05-06 Nathan Sidwell <nathan@codesourcery.com>
* config/mn10300/mn10300.c (print_operand): Use gcc_assert and
gcc_unreachable as appropriate.
(print_operand_address, mn10300_print_reg_list, expand_prologue,
expand_epilogue, notice_update_cc, initial_offset,
mn10300_address_cost_1): Likewise.
* config/mn10300/mn10300.md: Likewise.
(absdf2, abssf2, negdf2, negsf2): Likewise.
Index: config/mn10300/mn10300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mn10300/mn10300.c,v
retrieving revision 1.79
diff -c -3 -p -r1.79 mn10300.c
*** config/mn10300/mn10300.c 28 Apr 2005 05:38:42 -0000 1.79
--- config/mn10300/mn10300.c 6 May 2005 14:41:01 -0000
*************** print_operand (FILE *file, rtx x, int co
*** 220,226 ****
fprintf (file, "ul");
break;
default:
! abort ();
}
break;
}
--- 220,226 ----
fprintf (file, "ul");
break;
default:
! gcc_unreachable ();
}
break;
}
*************** print_operand (FILE *file, rtx x, int co
*** 258,264 ****
fprintf (file, "cs");
break;
default:
! abort ();
}
break;
case 'C':
--- 258,264 ----
fprintf (file, "cs");
break;
default:
! gcc_unreachable ();
}
break;
case 'C':
*************** print_operand (FILE *file, rtx x, int co
*** 289,295 ****
break;
default:
! abort ();
}
break;
--- 289,295 ----
break;
default:
! gcc_unreachable ();
}
break;
*************** print_operand (FILE *file, rtx x, int co
*** 348,354 ****
}
default:
! abort ();
}
break;
--- 348,354 ----
}
default:
! gcc_unreachable ();
}
break;
*************** print_operand (FILE *file, rtx x, int co
*** 384,390 ****
fprintf (file, "0x%lx", val[1]);
break;;
case SFmode:
! abort ();
case VOIDmode:
case DImode:
print_operand_address (file,
--- 384,390 ----
fprintf (file, "0x%lx", val[1]);
break;;
case SFmode:
! gcc_unreachable ();
case VOIDmode:
case DImode:
print_operand_address (file,
*************** print_operand (FILE *file, rtx x, int co
*** 405,411 ****
}
default:
! abort ();
}
break;
--- 405,411 ----
}
default:
! gcc_unreachable ();
}
break;
*************** print_operand (FILE *file, rtx x, int co
*** 419,432 ****
break;
case 'N':
! if (INTVAL (x) < -128 || INTVAL (x) > 255)
! abort ();
fprintf (file, "%d", (int)((~INTVAL (x)) & 0xff));
break;
case 'U':
! if (INTVAL (x) < -128 || INTVAL (x) > 255)
! abort ();
fprintf (file, "%d", (int)(INTVAL (x) & 0xff));
break;
--- 419,430 ----
break;
case 'N':
! gcc_assert (INTVAL (x) >= -128 && INTVAL (x) <= 255);
fprintf (file, "%d", (int)((~INTVAL (x)) & 0xff));
break;
case 'U':
! gcc_assert (INTVAL (x) >= -128 && INTVAL (x) <= 255);
fprintf (file, "%d", (int)(INTVAL (x) & 0xff));
break;
*************** print_operand (FILE *file, rtx x, int co
*** 484,490 ****
print_operand_address (file, x);
break;
default:
! abort ();
}
break;
}
--- 482,488 ----
print_operand_address (file, x);
break;
default:
! gcc_unreachable ();
}
break;
}
*************** print_operand_address (FILE *file, rtx a
*** 514,520 ****
&& REG_OK_FOR_BASE_P (XEXP (addr, 1)))
base = XEXP (addr, 1), index = XEXP (addr, 0);
else
! abort ();
print_operand (file, index, 0);
fputc (',', file);
print_operand (file, base, 0);;
--- 512,518 ----
&& REG_OK_FOR_BASE_P (XEXP (addr, 1)))
base = XEXP (addr, 1), index = XEXP (addr, 0);
else
! gcc_unreachable ();
print_operand (file, index, 0);
fputc (',', file);
print_operand (file, base, 0);;
*************** mn10300_print_reg_list (FILE *file, int
*** 571,578 ****
if ((mask & 0x3c000) != 0)
{
! if ((mask & 0x3c000) != 0x3c000)
! abort();
if (need_comma)
fputc (',', file);
fputs ("exreg1", file);
--- 569,575 ----
if ((mask & 0x3c000) != 0)
{
! gcc_assert ((mask & 0x3c000) == 0x3c000);
if (need_comma)
fputc (',', file);
fputs ("exreg1", file);
*************** expand_prologue (void)
*** 883,889 ****
break;
default:
! abort ();
}
/* Now prepare register a0, if we have decided to use it. */
--- 880,886 ----
break;
default:
! gcc_unreachable ();
}
/* Now prepare register a0, if we have decided to use it. */
*************** expand_prologue (void)
*** 905,911 ****
break;
default:
! abort ();
}
/* Now actually save the FP registers. */
--- 902,908 ----
break;
default:
! gcc_unreachable ();
}
/* Now actually save the FP registers. */
*************** expand_epilogue (void)
*** 1121,1127 ****
break;
default:
! abort ();
}
}
--- 1118,1124 ----
break;
default:
! gcc_unreachable ();
}
}
*************** notice_update_cc (rtx body, rtx insn)
*** 1252,1258 ****
break;
default:
! abort ();
}
}
--- 1249,1255 ----
break;
default:
! gcc_unreachable ();
}
}
*************** initial_offset (int from, int to)
*** 1443,1449 ****
+ (current_function_outgoing_args_size
? current_function_outgoing_args_size + 4 : 0));
! abort ();
}
/* Worker function for TARGET_RETURN_IN_MEMORY. */
--- 1440,1446 ----
+ (current_function_outgoing_args_size
? current_function_outgoing_args_size + 4 : 0));
! gcc_unreachable ();
}
/* Worker function for TARGET_RETURN_IN_MEMORY. */
*************** mn10300_address_cost_1 (rtx x, int *unsi
*** 1936,1942 ****
return 5;
default:
! abort ();
}
case PLUS:
--- 1933,1939 ----
return 5;
default:
! gcc_unreachable ();
}
case PLUS:
*************** mn10300_address_cost_1 (rtx x, int *unsi
*** 1973,1979 ****
return 8;
default:
! abort ();
}
}
--- 1970,1976 ----
return 8;
default:
! gcc_unreachable ();
}
}
Index: config/mn10300/mn10300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mn10300/mn10300.md,v
retrieving revision 1.59
diff -c -3 -p -r1.59 mn10300.md
*** config/mn10300/mn10300.md 19 Mar 2005 00:21:23 -0000 1.59
--- config/mn10300/mn10300.md 6 May 2005 14:41:06 -0000
***************
*** 109,115 ****
case 6:
return \"fmov %1,%0\";
default:
! abort ();
}
}"
[(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
--- 109,115 ----
case 6:
return \"fmov %1,%0\";
default:
! gcc_unreachable ();
}
}"
[(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
***************
*** 142,148 ****
case 4:
return \"movbu %1,%0\";
default:
! abort ();
}
}"
[(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit")])
--- 142,148 ----
case 4:
return \"movbu %1,%0\";
default:
! gcc_unreachable ();
}
}"
[(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit")])
***************
*** 202,208 ****
case 6:
return \"fmov %1,%0\";
default:
! abort ();
}
}"
[(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
--- 202,208 ----
case 6:
return \"fmov %1,%0\";
default:
! gcc_unreachable ();
}
}"
[(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
***************
*** 234,240 ****
case 4:
return \"movhu %1,%0\";
default:
! abort ();
}
}"
[(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit")])
--- 234,240 ----
case 4:
return \"movhu %1,%0\";
default:
! gcc_unreachable ();
}
}"
[(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit")])
***************
*** 378,384 ****
case 16:
return \"fmov %1,%0\";
default:
! abort ();
}
}"
[(set_attr "cc" "none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none,none_0hit,none_0hit")])
--- 378,384 ----
case 16:
return \"fmov %1,%0\";
default:
! gcc_unreachable ();
}
}"
[(set_attr "cc" "none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none,none_0hit,none_0hit")])
***************
*** 428,434 ****
}
return \"mov %1,%0\";
default:
! abort ();
}
}"
[(set_attr "cc" "none,none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
--- 428,434 ----
}
return \"mov %1,%0\";
default:
! gcc_unreachable ();
}
}"
[(set_attr "cc" "none,none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
***************
*** 509,516 ****
while (GET_CODE (temp) == SUBREG)
temp = SUBREG_REG (temp);
! if (GET_CODE (temp) != REG)
! abort ();
if (reg_overlap_mentioned_p (gen_rtx_REG (SImode, REGNO (temp)),
XEXP (operands[1], 0)))
--- 509,515 ----
while (GET_CODE (temp) == SUBREG)
temp = SUBREG_REG (temp);
! gcc_assert (GET_CODE (temp) == REG);
if (reg_overlap_mentioned_p (gen_rtx_REG (SImode, REGNO (temp)),
XEXP (operands[1], 0)))
***************
*** 598,604 ****
else
return \"fmov %L1, %L0\;fmov %H1, %H0\";
default:
! abort ();
}
}"
[(set (attr "cc")
--- 597,603 ----
else
return \"fmov %L1, %L0\;fmov %H1, %H0\";
default:
! gcc_unreachable ();
}
}"
[(set (attr "cc")
***************
*** 721,728 ****
while (GET_CODE (temp) == SUBREG)
temp = SUBREG_REG (temp);
! if (GET_CODE (temp) != REG)
! abort ();
if (reg_overlap_mentioned_p (gen_rtx_REG (SImode, REGNO (temp)),
XEXP (operands[1], 0)))
--- 720,726 ----
while (GET_CODE (temp) == SUBREG)
temp = SUBREG_REG (temp);
! gcc_assert (GET_CODE (temp) == REG);
if (reg_overlap_mentioned_p (gen_rtx_REG (SImode, REGNO (temp)),
XEXP (operands[1], 0)))
***************
*** 790,796 ****
return \"\";
}
default:
! abort ();
}
}"
[(set (attr "cc")
--- 788,794 ----
return \"\";
}
default:
! gcc_unreachable ();
}
}"
[(set (attr "cc")
***************
*** 971,977 ****
return \"mov %2,%0\;add %1,%0\";
}
default:
! abort ();
}
}"
[(set_attr "cc" "set_zn,none_0hit,set_zn,none_0hit,set_zn,none_0hit,set_zn")])
--- 969,975 ----
return \"mov %2,%0\;add %1,%0\";
}
default:
! gcc_unreachable ();
}
}"
[(set_attr "cc" "set_zn,none_0hit,set_zn,none_0hit,set_zn,none_0hit,set_zn")])
***************
*** 1013,1019 ****
return \"mov %1,%0\;add %2,%0\";
return \"mov %2,%0\;add %1,%0\";
default:
! abort ();
}
}"
[(set_attr "cc" "set_zn,none_0hit,none_0hit,set_zn,none_0hit,set_zn")])
--- 1011,1017 ----
return \"mov %1,%0\;add %2,%0\";
return \"mov %2,%0\;add %1,%0\";
default:
! gcc_unreachable ();
}
}"
[(set_attr "cc" "set_zn,none_0hit,none_0hit,set_zn,none_0hit,set_zn")])
***************
*** 2187,2194 ****
operand_subword_force (operands[1], 1, DFmode),
GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN);
! if (result == 0)
! abort ();
if (result != target)
emit_move_insn (result, target);
--- 2185,2191 ----
operand_subword_force (operands[1], 1, DFmode),
GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN);
! gcc_assert (result);
if (result != target)
emit_move_insn (result, target);
***************
*** 2222,2229 ****
result = expand_binop (SImode, and_optab,
operand_subword_force (operands[1], 0, SFmode),
GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN);
! if (result == 0)
! abort ();
if (result != target)
emit_move_insn (result, target);
--- 2219,2225 ----
result = expand_binop (SImode, and_optab,
operand_subword_force (operands[1], 0, SFmode),
GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN);
! gcc_assert (result);
if (result != target)
emit_move_insn (result, target);
***************
*** 2258,2265 ****
GEN_INT (trunc_int_for_mode (0x80000000, SImode)),
target, 0, OPTAB_WIDEN);
! if (result == 0)
! abort ();
if (result != target)
emit_move_insn (result, target);
--- 2254,2260 ----
GEN_INT (trunc_int_for_mode (0x80000000, SImode)),
target, 0, OPTAB_WIDEN);
! gcc_assert (result);
if (result != target)
emit_move_insn (result, target);
***************
*** 2294,2301 ****
operand_subword_force (operands[1], 0, SFmode),
GEN_INT (trunc_int_for_mode (0x80000000, SImode)),
target, 0, OPTAB_WIDEN);
! if (result == 0)
! abort ();
if (result != target)
emit_move_insn (result, target);
--- 2289,2295 ----
operand_subword_force (operands[1], 0, SFmode),
GEN_INT (trunc_int_for_mode (0x80000000, SImode)),
target, 0, OPTAB_WIDEN);
! gcc_assert (result);
if (result != target)
emit_move_insn (result, target);