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

[Bug target/44266] New: stack frame lacks parameter save area


A function that makes no other calls besides calls to __tls_get_addr does not
allocate a stack frame with a parameter save area.  According to the PowerPC64
ABI, any function that makes calls must allocate at least a 112 byte stack
frame.  This testcase, extracted from libstdc++

/* -m64 -fPIC -O2 */
int *
get_global (void)
{
  static __thread int global;
  return &global;
}

results in

        mflr 0
        std 0,16(1)
        stdu 1,-48(1)
        addi 3,2,.LANCHOR0@got@tlsld
        bl __tls_get_addr
        nop
        addi 1,1,48
        addis 3,3,.LANCHOR0@dtprel@ha
        addi 3,3,.LANCHOR0@dtprel@l
        ld 0,16(1)
        mtlr 0
        blr

Note the 48 byte stack frame.


-- 
           Summary: stack frame lacks parameter save area
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: amodra at gmail dot com
        ReportedBy: amodra at gmail dot com
GCC target triplet: powerpc64-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44266


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