https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94791
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-8 branch has been updated by Szabolcs Nagy <n...@gcc.gnu.org>: https://gcc.gnu.org/g:d4fcc365700f94fd15c67b30a3051aeabbb767bc commit r8-10641-gd4fcc365700f94fd15c67b30a3051aeabbb767bc Author: Szabolcs Nagy <szabolcs.n...@arm.com> Date: Tue Jun 2 16:44:41 2020 +0100 aarch64: fix return address access with pac [PR94891][PR94791] This is a big hammer fix for __builtin_return_address (PR target/94891) returning signed addresses (sometimes, depending on wether lr happens to be signed or not at the time of call which depends on optimizations), and similarly -pg may pass signed return address to _mcount (PR target/94791). At the time of return address expansion we don't know if it's signed or not so it is done unconditionally. 2020-07-13 Szabolcs Nagy <szabolcs.n...@arm.com> gcc/ChangeLog: PR target/94891 PR target/94791 * config/aarch64/aarch64-protos.h (aarch64_return_addr_rtx): Declare. * config/aarch64/aarch64.c (aarch64_return_addr_rtx): New. (aarch64_return_addr): Use aarch64_return_addr_rtx. * config/aarch64/aarch64.h (PROFILE_HOOK): Likewise. (cherry picked from commit 463a54e5d4956143f81c1f23b91cbd2d93855741)