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]

Fix for 991213-3.c in new arm backend


Hi Guys,

  I am about to apply the following patch to fix the failure of gcc
  testcase compile/991213-3.c in the new arm backend.  The testcase
  looks like this:

     int jump () { goto * (int (*) ()) 0xbabebec0; }

  and the expand for the ARM was failing to force the address into a
  register.

Cheers
	Nick

2000-03-08  Nick Clifton  <nickc@cygnus.com>

	* config/arm/arm.md (indirect_jump): Force constant addresses into
	a register. 

Index: gcc/config/arm/arm.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/arm/arm.md,v
retrieving revision 1.34.2.14
diff -p -r1.34.2.14 arm.md
*** arm.md	2000/03/01 16:49:20	1.34.2.14
--- arm.md	2000/03/09 01:04:22
***************
*** 6170,6178 ****
  
  (define_expand "indirect_jump"
    [(set (pc)
! 	(match_operand:SI 0 "general_operand" "rm"))]
    "TARGET_EITHER"
    "if (TARGET_THUMB && GET_CODE (operands[0]) != REG)
       operands[0] = force_reg (SImode, operands[0]);
    "
  )
--- 6170,6180 ----
  
  (define_expand "indirect_jump"
    [(set (pc)
! 	(match_operand:SI 0 "general_operand" ""))]
    "TARGET_EITHER"
    "if (TARGET_THUMB && GET_CODE (operands[0]) != REG)
+      operands[0] = force_reg (SImode, operands[0]);
+    else if (TARGET_ARM && GET_CODE (operands[0]) == CONST_INT)
       operands[0] = force_reg (SImode, operands[0]);
    "
  )

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