This is the mail archive of the gcc@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]

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



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