bfin.c (print_operand): Report error instead of ICE for wrong operand.
authorJie Zhang <jie.zhang@analog.com>
Fri, 24 Aug 2007 17:19:51 +0000 (17:19 +0000)
committerJie Zhang <jiez@gcc.gnu.org>
Fri, 24 Aug 2007 17:19:51 +0000 (17:19 +0000)
* config/bfin/bfin.c (print_operand): Report error instead of
ICE for wrong operand.

From-SVN: r127780

gcc/ChangeLog
gcc/config/bfin/bfin.c

index 8294c7f6bba23c8d6f8c898b59c388d26093da23..18b5a0b9a47bec45f6040b6cf5cf750e84eaa262 100644 (file)
@@ -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).
index 6b178ee2c5917d2a372bd9967c44dd3849dfe7c9..ac64215e26c42a875f561eb4fb6714210efd95f2 100644 (file)
@@ -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)]);