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]

Thumb backtrace breakage


Hi,
A customer found a problem with -mthumb -mtpcs-frame -mtpcs-leaf-frame
in that the register allocator would clobber 'fp'.  The attached
patch fixes this by making fp a fixed register when -mtpcs-frame or
-mtpcs-leaf-frame is given.  Note that TARGET_BACKTRACE cannot be used
because (a) we'll want to always reserve fp if one of the options is given,
but more importantly (b) leaf_function_p ICEs at the point in init_regs
that the register sets are initialized.

ok?

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2005-04-27  Nathan Sidwell  <nathan@codesourcery.com>

	* config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Reserve arm frame
	pointer when thumb backtracing is on.

*** gcc-3.3.1-orig/gcc/config/arm/arm.h	Tue Apr 26 14:32:48 2005
--- gcc-3.3.1/gcc/config/arm/arm.h	Wed Apr 27 14:06:11 2005
*************** extern const char * structure_size_strin
*** 973,979 ****
        fixed_regs[10]     = 1;					\
        call_used_regs[10] = 1;					\
      }								\
!   if (TARGET_APCS_FRAME)					\
      {								\
        fixed_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1;		\
        call_used_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1;	\
--- 973,980 ----
        fixed_regs[10]     = 1;					\
        call_used_regs[10] = 1;					\
      }								\
!   if ((target_flags & (THUMB_FLAG_LEAF_BACKTRACE | THUMB_FLAG_BACKTRACE)) \
!       || TARGET_APCS_FRAME)					\
      {								\
        fixed_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1;		\
        call_used_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1;	\

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