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]

Re: arm-pe: Do not generate type 2 LDM instructions with writeback


Hi Richard,

> > Don't you also need to undo the output_return_instruction change?

> No - we can generate a valid type 2 LDM in this case, if we have 
> an interrupt handler using apcs-32.

Or rather, yes, you are correct.  Doh.  Here is the patch.

Cheers
        Nick

Index: gcc/config/arm/arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.267
diff -c -3 -p -w -r1.267 arm.c
*** gcc/config/arm/arm.c	13 Mar 2003 13:27:17 -0000	1.267
--- gcc/config/arm/arm.c	13 Mar 2003 16:52:51 -0000
*************** output_return_instruction (operand, real
*** 8237,8247 ****
  		 character off in this case however, since the actual return
  		 instruction will be a MOVS which will restore the CPSR.  */
  	      if ((TARGET_APCS_32 && IS_INTERRUPT (func_type))
! 		  || (really_return
! 		      && ! frame_pointer_needed
! 		      && ((live_regs_mask & (1 << SP_REGNUM)) == 0)
! 		      && ((live_regs_mask & (1 << PC_REGNUM)) == 0))
! 		  )
  		strcat (p, "^");
  	    }
  	  else
--- 8237,8243 ----
  		 character off in this case however, since the actual return
  		 instruction will be a MOVS which will restore the CPSR.  */
  	      if ((TARGET_APCS_32 && IS_INTERRUPT (func_type))
! 		  || (! TARGET_APCS_32 && really_return))
  		strcat (p, "^");
  	    }
  	  else


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