This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]