From beed32b8faa92edd6808cfa4e6f999f683429610 Mon Sep 17 00:00:00 2001 From: Richard Earnshaw Date: Wed, 31 May 2006 13:39:48 +0000 Subject: [PATCH] arm.c (arm_print_operand case 'S'): Validate that the operand is a shift operand before calling shift_op. * 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 | 6 ++++++ gcc/config/arm/arm.c | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 04a83735875..170bfa54b04 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2006-05-31 Richard Earnshaw + + * 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 DJ Delorie diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index a26222a932b..a36c0d79176 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -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