[cfe-dev] [LLVMdev] Odd PPC inline asm constraint

Peter Bergner bergner at vnet.ibm.com
Sat May 12 06:44:04 PDT 2012

On Sat, 2012-05-12 at 00:47 -0500, Hal Finkel wrote:
> On Tue, 01 May 2012 21:25:29 -0500
> Peter Bergner <bergner at vnet.ibm.com> wrote:
> > By the strict letter of the 32-bit ABI, the save and restore of
> > r31 at a negative offset of r1 is verboten.  The ABI states the
> > the stack space below the stack pointer is declared as volatile.
> > I actually debugged a similar problem way back in my Blue Gene/L
> > days, where gcc had a bug and was doing the same thing.  We ended
> > up taking a signal between the restore of the stack pointer and
> > the restore of the nonvolatile reg and the BGL compute node kernel
> > trashed the stack below the stack pointer.
> Just to confirm, this is an issue specific to the 32-bit ABI, correct?
> gcc (4.4.6) seems to do the same thing for PPC64.

Correct, this is a specific 32-bit ABI issue.  The 64-bit ABI allows
some access below the stack pointer.  From the 64-bit ABI:

    The 288 bytes below the stack pointer is available as volatile
    storage which is not preserved across function calls. Interrupt
    handlers and any other functions that might run without an explicit
    call must take care to preserve this region. If a function does not
    need more stack space than is available in this area, it does not
    need to have a stack frame.


More information about the cfe-dev mailing list