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]

arm.c: Do not allow the IP register as a DFmode operand.


Hi Guys,

  The IP register (number 12) is not suitable to hold a DFmode
  quantity, since its higher numbered counterpart (13) is the stack
  pointer, but the soft_fp predicates in arm.c were allowing it.  This
  patch fixes the problem.

  Note that most of this patch was accidentally applied as part of the
  formatting tidy up patch that I checked in this morning.  That was
  not my intention, and I apologise for any confusion that this may
  have caused.

Cheers
        Nick

2002-01-16  Nick Clifton  <nickc@cambridge.redhat.com>

	* config/arm/arm.c (soft_df_operand): Do not accept the IP
	register.
	(nonimmediate_soft_df_operand): Do not accept the IP register.

Index: config/arm/arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.186
diff -c -3 -p -w -r1.186 arm.c
*** arm.c	2002/01/16 16:37:20	1.186
--- arm.c	2002/01/16 16:41:06
*************** soft_df_operand (op, mode)
*** 3342,3348 ****
       enum machine_mode mode;
  {
    if (s_register_operand (op, mode))
!     return TRUE;
  
    if (mode != VOIDmode && GET_MODE (op) != mode)
      return FALSE;
--- 3358,3371 ----
       enum machine_mode mode;
  {
    if (s_register_operand (op, mode))
+     {
+       if (GET_CODE (op) == SUBREG)
+ 	op = SUBREG_REG (op);
+ 
+       /* The IP register must not be used, since its higher
+ 	 numbered counterpart is 13 - the stack pointer.  */
!       return REGNO (op) != IP_REGNUM;
+     }
  
    if (mode != VOIDmode && GET_MODE (op) != mode)
      return FALSE;
*************** nonimmediate_soft_df_operand (op, mode)
*** 3367,3379 ****
       enum machine_mode mode;
  {
    if (s_register_operand (op, mode))
!     return TRUE;
  
    if (mode != VOIDmode && GET_MODE (op) != mode)
      return FALSE;
--- 3390,3410 ----
       enum machine_mode mode;
  {
    if (s_register_operand (op, mode))
+     {
+       if (GET_CODE (op) == SUBREG)
+ 	op = SUBREG_REG (op);
+ 
+       /* The IP register must not be used, since its higher
+ 	 numbered counterpart is 13 - the stack pointer.  */
!       return REGNO (op) != IP_REGNUM;
+     }
  
    if (mode != VOIDmode && GET_MODE (op) != mode)
      return FALSE;


  


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