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: unassig...@gcc.gnu.org

        ReportedBy: g...@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

Reply via email to