aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJie Zhang <jie.zhang@analog.com>2007-08-24 17:19:51 +0000
committerJie Zhang <jiez@gcc.gnu.org>2007-08-24 17:19:51 +0000
commitb570063aaa0fdbbfdff4327434d54a452ae2df2a (patch)
tree76a293a81ebba635baadf4e6cc260df4a9c5698a /gcc
parent48f9f863e485dd375da902a2b0bdbf99668e5de4 (diff)
downloadgcc-b570063aaa0fdbbfdff4327434d54a452ae2df2a.zip
gcc-b570063aaa0fdbbfdff4327434d54a452ae2df2a.tar.gz
gcc-b570063aaa0fdbbfdff4327434d54a452ae2df2a.tar.bz2
bfin.c (print_operand): Report error instead of ICE for wrong operand.
* config/bfin/bfin.c (print_operand): Report error instead of ICE for wrong operand. From-SVN: r127780
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/bfin/bfin.c45
2 files changed, 33 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8294c7f..18b5a0b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2007-08-24 Jie Zhang <jie.zhang@analog.com>
+
+ * config/bfin/bfin.c (print_operand): Report error instead of
+ ICE for wrong operand.
+
2007-08-24 Michael Matz <matz@suse.de>
* Makefile.in (GTFILES_H): Use $(patsubst) instead of $(subst).
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index 6b178ee..ac64215 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -1310,26 +1310,31 @@ print_operand (FILE *file, rtx x, char code)
case REG:
if (code == 'h')
{
- gcc_assert (REGNO (x) < 32);
- fprintf (file, "%s", short_reg_names[REGNO (x)]);
- /*fprintf (file, "\n%d\n ", REGNO (x));*/
- break;
+ if (REGNO (x) < 32)
+ fprintf (file, "%s", short_reg_names[REGNO (x)]);
+ else
+ output_operand_lossage ("invalid operand for code '%c'", code);
}
else if (code == 'd')
{
- gcc_assert (REGNO (x) < 32);
- fprintf (file, "%s", high_reg_names[REGNO (x)]);
- break;
+ if (REGNO (x) < 32)
+ fprintf (file, "%s", high_reg_names[REGNO (x)]);
+ else
+ output_operand_lossage ("invalid operand for code '%c'", code);
}
else if (code == 'w')
{
- gcc_assert (REGNO (x) == REG_A0 || REGNO (x) == REG_A1);
- fprintf (file, "%s.w", reg_names[REGNO (x)]);
+ if (REGNO (x) == REG_A0 || REGNO (x) == REG_A1)
+ fprintf (file, "%s.w", reg_names[REGNO (x)]);
+ else
+ output_operand_lossage ("invalid operand for code '%c'", code);
}
else if (code == 'x')
{
- gcc_assert (REGNO (x) == REG_A0 || REGNO (x) == REG_A1);
- fprintf (file, "%s.x", reg_names[REGNO (x)]);
+ if (REGNO (x) == REG_A0 || REGNO (x) == REG_A1)
+ fprintf (file, "%s.x", reg_names[REGNO (x)]);
+ else
+ output_operand_lossage ("invalid operand for code '%c'", code);
}
else if (code == 'v')
{
@@ -1342,18 +1347,24 @@ print_operand (FILE *file, rtx x, char code)
}
else if (code == 'D')
{
- fprintf (file, "%s", dregs_pair_names[REGNO (x)]);
+ if (D_REGNO_P (REGNO (x)))
+ fprintf (file, "%s", dregs_pair_names[REGNO (x)]);
+ else
+ output_operand_lossage ("invalid operand for code '%c'", code);
}
else if (code == 'H')
{
- gcc_assert (mode == DImode || mode == DFmode);
- gcc_assert (REG_P (x));
- fprintf (file, "%s", reg_names[REGNO (x) + 1]);
+ if ((mode == DImode || mode == DFmode) && REG_P (x))
+ fprintf (file, "%s", reg_names[REGNO (x) + 1]);
+ else
+ output_operand_lossage ("invalid operand for code '%c'", code);
}
else if (code == 'T')
{
- gcc_assert (D_REGNO_P (REGNO (x)));
- fprintf (file, "%s", byte_reg_names[REGNO (x)]);
+ if (D_REGNO_P (REGNO (x)))
+ fprintf (file, "%s", byte_reg_names[REGNO (x)]);
+ else
+ output_operand_lossage ("invalid operand for code '%c'", code);
}
else
fprintf (file, "%s", reg_names[REGNO (x)]);