This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for dwarf2 EH on ARM
- To: Jason Merrill <jason at cygnus dot com>
- Subject: Re: Patch for dwarf2 EH on ARM
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Thu, 23 Mar 2000 12:19:02 +0000
- Cc: gcc-patches at gcc dot gnu dot org
- Cc: rearnsha at arm dot com
- Organization: ARM Ltd.
- Reply-To: rearnsha at arm dot com
jason@cygnus.com said:
> I had an interesting time tracking down some of the problems with this
> port. Why do we use a callee-saved register for the static chain on
> ARM?
Probably because it's broken.
The fundamental problem is that the only registers that are not
callee-saved are r0-r3, r12 (ip) and r14 (lr). r0-r3 contain arguments
and r12 is often needed as a scratch in the prologue (worse still, r12 is
almost unusable in Thumb mode because it is a high register). Finally,
r14 contains the return address, so can't be used for the static chain
either.
Rewriting the prologue code to avoid use of r12 is possible, but makes the
prologue significantly less efficient, so we wouldn't want to do it in
general. Finally, there are variants of the APCS that use r12 for passing
the static base around when compiling for PIC (though gcc doesn't
currently support these variants, and may never do). I'm not sure what
the new ATPCS says about use of r12; I'll have to check.
R.