[Bug target/81996] powerpc __builtin_return_address(0) fails with -fPIC -fstack-protector-all or -fsanitize=address
amodra at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Sep 21 12:56:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81996
--- Comment #8 from Alan Modra <amodra at gcc dot gnu.org> ---
Author: amodra
Date: Thu Sep 21 12:55:37 2017
New Revision: 253067
URL: https://gcc.gnu.org/viewcvs?rev=253067&root=gcc&view=rev
Log:
PR81996, __builtin_return_address(0) fails
rs6000_return_addr assumes that the stack link is at frame+0, which is
true for count>0. For count==0, rs6000_return_addr is called with
frame==frame_pointer_rtx and the stack link is *not* at frame+0 if
-fstack-protector-all or -fsanitize=address because rs6000.h sets
FRAME_GROWS_DOWNWARD for those options.
PR target/81996
* gcc/config/rs6000/rs6000.c (rs6000_return_addr): Use
stack_pointer_rtx for count 0. Update comments. Break up
large rtl expression.
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/rs6000/rs6000.c
More information about the Gcc-bugs
mailing list