Re: Use of r31 on the powerpc/booke:mpc85xx architecture

Matt Thomas <[email protected]>
Newsgroups gmane.os.netbsd.ports.powerpc
Message-ID <[email protected]>
On Sep 12, 2012, at 10:18 AM, Scislowicz, Adam wrote:

> After reading the various ABI guides it seems like the original workaround to appease -fno-omit-frame-pointer may have unintended side effects. If GCC is no longer aware of r31 being tampered with it cannot be guaranteed to preserve r31 in the GP Regs section of the stack via the generated prologue and epilogue.

It has no need to do that since (as far as it call tell) r31 is not changed.  It is temporarily used but that use does not change its value as far as the compiler is concerned.  It's no different than r31 being changed in a function call; as long as the callee restores its value then it doesn't.

> Would it not be better to for now state that -fno-omit-frame-pointer is violating the ABI used in practice and should be avoided on the powerpc platform? In my search for understanding I found people coming to a similar conslusion in their use of gcc to compile the Linux kernel for the powerpc architecture.

Documenting that is problematic.  If you changes things and thing break, stop doing that.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.