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. Optimize some frame-pointer return cases


One of the consequences of the patch that Nathan and I prepared to fix 
problems with stack discipline on ARM was that there was a noticeable 
increase in code size from the extra instruction needed.  This patch goes 
a long way towards eliminating that overhead by noticing when the stack 
pointer already contains the correct address for the return.  On most ARM 
platforms this reduces the burden of avoiding this problem by about 60%.  
On platforms that require 8-byte stack alignment the reduction is 
approximately half that, but there are more tricks that I might yet be 
able to apply (once I've worked out the logic).

Bootstrapped on arm-netbsdelf and full regression-tested on arm-elf.

R.

2003-10-28  Richard Earnshaw  <rearnsha@arm.com>

	* arm.c (arm_output_epilogue): When using a frame pointer, don't emit
	an extra stack adjustment insn if the stack pointer is already 
	pointing at the right place.
	(use_return_insn): Allow a return insn to be used when we have a
	frame pointer if the stack pointer is in the right place.
	(output_return_instruction): Handle it.


Attachment: frame-ret.patch
Description: frame-ret.patch


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