This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/81996] __builtin_return_address(0) does not work on powerpc in -fPIC mode and causes SIGSEGVs
- From: "slyfox at inbox dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 27 Aug 2017 07:48:05 +0000
- Subject: [Bug c/81996] __builtin_return_address(0) does not work on powerpc in -fPIC mode and causes SIGSEGVs
- Auto-submitted: auto-generated
- References: <bug-81996-4@http.gcc.gnu.org/bugzilla/>
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