[PATCH] PR 23355 Fix poor Thumb code prologues when generating PIC

Richard Earnshaw rearnsha@gcc.gnu.org
Tue Aug 16 09:41:00 GMT 2005


The prologue/epilogue code for Thumb was unconditionally saving and
restoring the PIC register even when the function in question referenced
no static data.  This patch uses similar logic to that used for ARM
state so that we now only save the PIC register when it is really
needed.  This is especially important on Thumb because the PIC register
is a high register and thus we have to jump through hoops to put it onto
the stack.

Tested on arm-elf with no regressions and by inspection for generating
PIC prologues.

R.

2005-08-15  Richard Earnshaw  <richard.earnshaw@arm.com>

	PR target/23355
	* arm.c (thumb_compute_save_reg_mask): Use similar logic to 
	arm_compure_save_reg0_reg12_mask to determine when the PIC register
	must be saved.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: thumb-pic.patch
Type: text/x-patch
Size: 1189 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050816/4a242ac3/attachment.bin>


More information about the Gcc-patches mailing list