[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
Mon Sep 18 02:25:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81996
--- Comment #7 from Alan Modra <amodra at gcc dot gnu.org> ---
Author: amodra
Date: Mon Sep 18 02:25:10 2017
New Revision: 252901
URL: https://gcc.gnu.org/viewcvs?rev=252901&root=gcc&view=rev
Log:
[RS6000] 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:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/rs6000.c
More information about the Gcc-bugs
mailing list