]> git.ipfire.org Git - thirdparty/gcc.git/commit
[RS6000] PR81996, __builtin_return_address(0) fails
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 Sep 2017 02:25:10 +0000 (02:25 +0000)
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 Sep 2017 02:25:10 +0000 (02:25 +0000)
commit12543f37d5da5bcb975d47f473cf52908238f067
tree0b9349065d60fb914971689fffdd7e3e7c0de184
parent86391760bb3d30220a70eae95c0bb63af829b348
[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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@252901 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/rs6000/rs6000.c