This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH ARM] Fix PR target/27829
- From: Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- To: gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 31 May 2006 14:49:14 +0100
- Subject: [PATCH ARM] Fix PR target/27829
This patch fixes an ICE on ARM platforms if the user generates a bogus
asm statement that uses the 'S' output operand code incorrectly.
tested on an arm-elf cross and installed on trunk.
2006-05-31 Richard Earnshaw <richard.earnshaw@arm.com>
PR target/27829
* 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.
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
*** arm.c (revision 113501)
--- arm.c (local)
*************** arm_print_operand (FILE *stream, rtx x,
*** 11017,11027 ****
case 'S':
{
HOST_WIDE_INT val;
! const char * shift = shift_op (x, &val);
if (shift)
{
! fprintf (stream, ", %s ", shift_op (x, &val));
if (val == -1)
arm_print_operand (stream, XEXP (x, 1), 0);
else
--- 11017,11035 ----
case 'S':
{
HOST_WIDE_INT 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);
if (val == -1)
arm_print_operand (stream, XEXP (x, 1), 0);
else