This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Thumb backtrace breakage
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Paul Brook <paul at codesourcery dot com>
- Date: Wed, 27 Apr 2005 14:19:32 +0100
- Subject: Thumb backtrace breakage
- Organization: CodeSourcery LLC
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; \