arm.c (arm_print_operand case 'S'): Validate that the operand is a shift operand...
authorRichard Earnshaw <rearnsha@arm.com>
Wed, 31 May 2006 13:39:48 +0000 (13:39 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Wed, 31 May 2006 13:39:48 +0000 (13:39 +0000)
* arm.c (arm_print_operand case 'S'): Validate that the operand is
a shift operand before calling shift_op.  Avoid redundant call of
shift_op.

From-SVN: r114264

gcc/ChangeLog
gcc/config/arm/arm.c

index 04a83735875fcebcbdabcb91a647ab07ef861181..170bfa54b04831e4f1bef16832a6a102612519b6 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-31  Richard Earnshaw  <richard.earnshaw@arm.com>
+
+       * arm.c (arm_print_operand case 'S'): Validate that the operand is
+       a shift operand before calling shift_op.  Avoid redundant call of
+       shift_op.
+
 2006-05-30  Naveen.H.S  <naveenh@kpitcummins.com>
            DJ Delorie  <dj@redhat.com>
 
index a26222a932b5ccd0f63759cf603c22d53ac25dc0..a36c0d791760a80f655959c86681fb9ef131945c 100644 (file)
@@ -11013,11 +11013,19 @@ arm_print_operand (FILE *stream, rtx x, int code)
     case 'S':
       {
        HOST_WIDE_INT val;
-       const char * shift = shift_op (x, &val);
+       const char *shift;
+
+       if (!shift_operator (x, SImode))
+         {
+           output_operand_lossage ("invalid shift operand");
+           break;
+         }
+
+       shift = shift_op (x, &val);
 
        if (shift)
          {
-           fprintf (stream, ", %s ", shift_op (x, &val));
+           fprintf (stream, ", %s ", shift);
            if (val == -1)
              arm_print_operand (stream, XEXP (x, 1), 0);
            else