diff options
author | Richard Earnshaw <rearnsha@arm.com> | 2006-05-31 13:39:48 +0000 |
---|---|---|
committer | Richard Earnshaw <rearnsha@gcc.gnu.org> | 2006-05-31 13:39:48 +0000 |
commit | beed32b8faa92edd6808cfa4e6f999f683429610 (patch) | |
tree | 6ebdedb4b211156768bb2bd1ce1493c69573d694 | |
parent | c32827b0e602618862ffcf0047837a1d4a64eed6 (diff) | |
download | gcc-beed32b8faa92edd6808cfa4e6f999f683429610.zip gcc-beed32b8faa92edd6808cfa4e6f999f683429610.tar.gz gcc-beed32b8faa92edd6808cfa4e6f999f683429610.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 12 |
2 files changed, 16 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 04a8373..170bfa5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index a26222a..a36c0d7 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 |