This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Incorrectly using call-clobbered registers
- From: <tm_gccmail at mail dot kloo dot net>
- To: Carlos Sánchez de La Lama <csanchez at teisa dot unican dot es>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 6 Mar 2003 12:11:52 -0800 (PST)
- Subject: Re: Incorrectly using call-clobbered registers
On 6 Mar 2003, Carlos Sánchez de La Lama wrote:
> Hi everyone!
>
> I'm working with a port of gcc for the OpenRISC architecture, but I've a
> question that I think is better to post here than in OpenRISC forum.
>
> In that architecture, register r11 is used to hold return value from
> functions, but I've found that in certain cases the compiler uses it as
> a general register and, before a function call, saves its value on the
> stack, restoring it *just* after function call, and therefore losing the
> returned value. The next instructions try to get the value out of r11,
> but it's not longer there, and as it was a pointer it all end in a
> Alignment Error.
You may want to look at the SH port. The SH has PR, which is the return
address register.
Toshi