aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorCarlos O'Donell <carlos@codesourcery.com>2006-06-01 03:43:00 +0000
committerCarlos O'Donell <carlos@codesourcery.com>2006-06-01 03:43:00 +0000
commit8e1c368c4c8ce371f0b90f34f7d50793c9cb7ed8 (patch)
tree2b31c42e643cf23cb6ad516fc9b68972f35b145a /gcc
parentccebffc137b387c59490ceb4547f162c7f0b190a (diff)
2006-05-31 Carlos O'Donell <carlos@codesourcery.com>
Backport from mainline: 2006-05-31 Richard Earnshaw <richard.earnshaw@arm.com> PR target/27829 * gcc/config/arm/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. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/csl/sourcerygxx-4_1@114294 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/arm/arm.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index c151c83b3df..ebc00935b78 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -11573,11 +11573,18 @@ 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