This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81996] powerpc __builtin_return_address(0) fails with -fPIC -fstack-protector-all or -fsanitize=address
- From: "amodra at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 17 Sep 2017 04:01:06 +0000
- Subject: [Bug target/81996] powerpc __builtin_return_address(0) fails with -fPIC -fstack-protector-all or -fsanitize=address
- Auto-submitted: auto-generated
- References: <bug-81996-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81996
Alan Modra <amodra at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|__builtin_return_address(0) |powerpc
|does not work on powerpc in |__builtin_return_address(0)
|-fPIC -fstack-protector-all |fails with -fPIC
|mode and causes SIGSEGVs |-fstack-protector-all or
| |-fsanitize=address
--- Comment #6 from Alan Modra <amodra at gmail dot com> ---
It looks like this is FRAME_GROWS_DOWNWARD, which rs6000.h sets true for
flag_stack_protect. And, yes, -fsanitize=address shows the same sort of error,
reading an offset from r1 instead of 0(r1) to get the previous frame where lr
is saved.