[Bug c++/56606] New: GCC refuses to emit long calls for operator new/delete on PowerPC

gcc at mrozekma dot com gcc-bugzilla@gcc.gnu.org
Tue Mar 12 20:26:00 GMT 2013


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

             Bug #: 56606
           Summary: GCC refuses to emit long calls for operator new/delete
                    on PowerPC
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gcc@mrozekma.com


-mlongcall seems to have no effect on operator new and operator delete. For
example, given the code:

> extern void foo();
> void bar() {
>     foo();
>     new char;
> }

A normal run of GCC on PowerPC will generate the (abridged) assembly:

> bl _Z3foov
> bl _Znwj

Running GCC with the -mlongcall option generates:

> lis r9, _Z3foov@ha
> addi r9, r9, _Z3foov@l
> mtctr r9
> bctrl
> bl _Znwj

The branch to foo() was expanded as expected, but the branch to operator new is
still short. Calls to random libc and libstdc++ functions are all converted; so
far operator new and operator delete are the only ones I've seen that don't
work. This seems similar to bug 12769, but that was for generated functions

---

GCC build info:

> Target: ppc-redhat-linux
> Configured with: ./configure --prefix=/opt/gcc-4.7.2-ppc --mandir=/opt/gcc-4.7.2-ppc/share/man --enable-shared --enable-threads=posix --with-system-zlib --enable-languages=c,c++ --build=ppc-redhat-linux --host=ppc-redhat-linux --target=ppc-redhat-linux
> gcc version 4.7.2 (GCC) 

Test compiled with:

> g++ -mlongcall -c -o test.o test.cpp



More information about the Gcc-bugs mailing list