Commit 22de4c3d by Richard Earnshaw Committed by Richard Earnshaw

arm.c (arm_print_operand): Use output_operand_lossage where possible rather than aborting.

* arm.c (arm_print_operand): Use output_operand_lossage where possible
rather than aborting.

From-SVN: r88940
parent 5b94d9dd
2004-10-12 Richard Earnshaw <rearnsha@arm.com>
* arm.c (arm_print_operand): Use output_operand_lossage where possible
rather than aborting.
2004-10-12 Paul Brook <paul@coudesourcery.com> 2004-10-12 Paul Brook <paul@coudesourcery.com>
* config.gcc: Add armv6{k,z,zk} * config.gcc: Add armv6{k,z,zk}
......
...@@ -10287,8 +10287,17 @@ arm_print_operand (FILE *stream, rtx x, int code) ...@@ -10287,8 +10287,17 @@ arm_print_operand (FILE *stream, rtx x, int code)
case '?': case '?':
if (arm_ccfsm_state == 3 || arm_ccfsm_state == 4) if (arm_ccfsm_state == 3 || arm_ccfsm_state == 4)
{ {
if (TARGET_THUMB || current_insn_predicate != NULL) if (TARGET_THUMB)
abort (); {
output_operand_lossage ("predicated Thumb instruction");
break;
}
if (current_insn_predicate != NULL)
{
output_operand_lossage
("predicated instruction in conditional sequence");
break;
}
fputs (arm_condition_codes[arm_current_cc], stream); fputs (arm_condition_codes[arm_current_cc], stream);
} }
...@@ -10297,7 +10306,10 @@ arm_print_operand (FILE *stream, rtx x, int code) ...@@ -10297,7 +10306,10 @@ arm_print_operand (FILE *stream, rtx x, int code)
enum arm_cond_code code; enum arm_cond_code code;
if (TARGET_THUMB) if (TARGET_THUMB)
abort (); {
output_operand_lossage ("predicated Thumb instruction");
break;
}
code = get_arm_condition_code (current_insn_predicate); code = get_arm_condition_code (current_insn_predicate);
fputs (arm_condition_codes[code], stream); fputs (arm_condition_codes[code], stream);
...@@ -10389,20 +10401,32 @@ arm_print_operand (FILE *stream, rtx x, int code) ...@@ -10389,20 +10401,32 @@ arm_print_operand (FILE *stream, rtx x, int code)
of the memory location is actually held in one of the registers of the memory location is actually held in one of the registers
being overwritten by the load. */ being overwritten by the load. */
case 'Q': case 'Q':
if (REGNO (x) > LAST_ARM_REGNUM) if (GET_CODE (x) != REG || REGNO (x) > LAST_ARM_REGNUM)
abort (); {
output_operand_lossage ("invalid operand for code '%c'", code);
return;
}
asm_fprintf (stream, "%r", REGNO (x) + (WORDS_BIG_ENDIAN ? 1 : 0)); asm_fprintf (stream, "%r", REGNO (x) + (WORDS_BIG_ENDIAN ? 1 : 0));
return; return;
case 'R': case 'R':
if (REGNO (x) > LAST_ARM_REGNUM) if (GET_CODE (x) != REG || REGNO (x) > LAST_ARM_REGNUM)
abort (); {
output_operand_lossage ("invalid operand for code '%c'", code);
return;
}
asm_fprintf (stream, "%r", REGNO (x) + (WORDS_BIG_ENDIAN ? 0 : 1)); asm_fprintf (stream, "%r", REGNO (x) + (WORDS_BIG_ENDIAN ? 0 : 1));
return; return;
case 'H': case 'H':
if (REGNO (x) > LAST_ARM_REGNUM) if (GET_CODE (x) != REG || REGNO (x) > LAST_ARM_REGNUM)
abort (); {
output_operand_lossage ("invalid operand for code '%c'", code);
return;
}
asm_fprintf (stream, "%r", REGNO (x) + 1); asm_fprintf (stream, "%r", REGNO (x) + 1);
return; return;
...@@ -10423,6 +10447,12 @@ arm_print_operand (FILE *stream, rtx x, int code) ...@@ -10423,6 +10447,12 @@ arm_print_operand (FILE *stream, rtx x, int code)
if (x == const_true_rtx) if (x == const_true_rtx)
return; return;
if (!COMPARISON_P (x))
{
output_operand_lossage ("invalid operand for code '%c'", code);
return;
}
fputs (arm_condition_codes[get_arm_condition_code (x)], fputs (arm_condition_codes[get_arm_condition_code (x)],
stream); stream);
return; return;
...@@ -10431,7 +10461,15 @@ arm_print_operand (FILE *stream, rtx x, int code) ...@@ -10431,7 +10461,15 @@ arm_print_operand (FILE *stream, rtx x, int code)
/* CONST_TRUE_RTX means not always -- i.e. never. We shouldn't ever /* CONST_TRUE_RTX means not always -- i.e. never. We shouldn't ever
want to do that. */ want to do that. */
if (x == const_true_rtx) if (x == const_true_rtx)
abort (); {
output_operand_lossage ("instruction never exectued");
return;
}
if (!COMPARISON_P (x))
{
output_operand_lossage ("invalid operand for code '%c'", code);
return;
}
fputs (arm_condition_codes[ARM_INVERSE_CONDITION_CODE fputs (arm_condition_codes[ARM_INVERSE_CONDITION_CODE
(get_arm_condition_code (x))], (get_arm_condition_code (x))],
...@@ -10463,7 +10501,10 @@ arm_print_operand (FILE *stream, rtx x, int code) ...@@ -10463,7 +10501,10 @@ arm_print_operand (FILE *stream, rtx x, int code)
int mode = GET_MODE (x); int mode = GET_MODE (x);
if (GET_CODE (x) != REG || REGNO_REG_CLASS (REGNO (x)) != CIRRUS_REGS) if (GET_CODE (x) != REG || REGNO_REG_CLASS (REGNO (x)) != CIRRUS_REGS)
abort (); {
output_operand_lossage ("invalid operand for code '%c'", code);
return;
}
fprintf (stream, "mv%s%s", fprintf (stream, "mv%s%s",
mode == DFmode ? "d" mode == DFmode ? "d"
...@@ -10479,7 +10520,11 @@ arm_print_operand (FILE *stream, rtx x, int code) ...@@ -10479,7 +10520,11 @@ arm_print_operand (FILE *stream, rtx x, int code)
|| REGNO (x) < FIRST_IWMMXT_GR_REGNUM || REGNO (x) < FIRST_IWMMXT_GR_REGNUM
|| REGNO (x) > LAST_IWMMXT_GR_REGNUM) || REGNO (x) > LAST_IWMMXT_GR_REGNUM)
/* Bad value for wCG register number. */ /* Bad value for wCG register number. */
abort (); {
output_operand_lossage ("invalid operand for code '%c'", code);
return;
}
else else
fprintf (stream, "%d", REGNO (x) - FIRST_IWMMXT_GR_REGNUM); fprintf (stream, "%d", REGNO (x) - FIRST_IWMMXT_GR_REGNUM);
return; return;
...@@ -10490,7 +10535,11 @@ arm_print_operand (FILE *stream, rtx x, int code) ...@@ -10490,7 +10535,11 @@ arm_print_operand (FILE *stream, rtx x, int code)
|| INTVAL (x) < 0 || INTVAL (x) < 0
|| INTVAL (x) >= 16) || INTVAL (x) >= 16)
/* Bad value for wC register number. */ /* Bad value for wC register number. */
abort (); {
output_operand_lossage ("invalid operand for code '%c'", code);
return;
}
else else
{ {
static const char * wc_reg_names [16] = static const char * wc_reg_names [16] =
...@@ -10512,15 +10561,24 @@ arm_print_operand (FILE *stream, rtx x, int code) ...@@ -10512,15 +10561,24 @@ arm_print_operand (FILE *stream, rtx x, int code)
int num; int num;
if (mode != DImode && mode != DFmode) if (mode != DImode && mode != DFmode)
abort (); {
output_operand_lossage ("invalid operand for code '%c'", code);
return;
}
if (GET_CODE (x) != REG if (GET_CODE (x) != REG
|| !IS_VFP_REGNUM (REGNO (x))) || !IS_VFP_REGNUM (REGNO (x)))
abort (); {
output_operand_lossage ("invalid operand for code '%c'", code);
return;
}
num = REGNO(x) - FIRST_VFP_REGNUM; num = REGNO(x) - FIRST_VFP_REGNUM;
if (num & 1) if (num & 1)
abort (); {
output_operand_lossage ("invalid operand for code '%c'", code);
return;
}
fprintf (stream, "d%d", num >> 1); fprintf (stream, "d%d", num >> 1);
} }
...@@ -10528,7 +10586,10 @@ arm_print_operand (FILE *stream, rtx x, int code) ...@@ -10528,7 +10586,10 @@ arm_print_operand (FILE *stream, rtx x, int code)
default: default:
if (x == 0) if (x == 0)
abort (); {
output_operand_lossage ("missing operand");
return;
}
if (GET_CODE (x) == REG) if (GET_CODE (x) == REG)
asm_fprintf (stream, "%r", REGNO (x)); asm_fprintf (stream, "%r", REGNO (x));
......
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