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 c/81996] __builtin_return_address(0) does not work on powerpc in -fPIC mode and causes SIGSEGVs


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81996

--- Comment #2 from Sergei Trofimovich <slyfox at inbox dot ru> ---
gcc master is slightly better here but is still inefficient in fPIC mode:

gcc -O2 -fno-PIC:

    f:
        mflr 3
        blr

gcc -O2 -fPIC:

    f:
        stwu 1,-16(1)
        mflr 0
        stw 0,20(1)
        stw 30,8(1)
        lwz 9,0(1)
        lwz 0,20(1)
        lwz 3,4(9)
        lwz 30,8(1)
        mtlr 0
        addi 1,1,16
        blr

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