diff options
author | Trevor Saunders <tbsaunde+gcc@tbsaunde.org> | 2015-10-11 00:47:52 +0000 |
---|---|---|
committer | Trevor Saunders <tbsaunde@gcc.gnu.org> | 2015-10-11 00:47:52 +0000 |
commit | 579f294624827c80f01af119cc3f52265371a353 (patch) | |
tree | 958aebb2d2c94f1f98bea8a75d49e20cf70530c9 /gcc/builtins.c | |
parent | 9c02b29a8734d902ba76096f4acdd3dfb5aa7292 (diff) | |
download | gcc-579f294624827c80f01af119cc3f52265371a353.zip gcc-579f294624827c80f01af119cc3f52265371a353.tar.gz gcc-579f294624827c80f01af119cc3f52265371a353.tar.bz2 |
always define INITIAL_FRAME_ADDRESS_RTX
gcc/ChangeLog:
2015-10-10 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* builtins.c (expand_builtin_return_addr): Adjust.
* defaults.h (INITIAL_FRAME_ADDRESS_RTX): New default definition.
From-SVN: r228685
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 643eeef..3bbe763 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -761,31 +761,28 @@ static rtx expand_builtin_return_addr (enum built_in_function fndecl_code, int count) { int i; - -#ifdef INITIAL_FRAME_ADDRESS_RTX rtx tem = INITIAL_FRAME_ADDRESS_RTX; -#else - rtx tem; - - /* For a zero count with __builtin_return_address, we don't care what - frame address we return, because target-specific definitions will - override us. Therefore frame pointer elimination is OK, and using - the soft frame pointer is OK. - - For a nonzero count, or a zero count with __builtin_frame_address, - we require a stable offset from the current frame pointer to the - previous one, so we must use the hard frame pointer, and - we must disable frame pointer elimination. */ - if (count == 0 && fndecl_code == BUILT_IN_RETURN_ADDRESS) - tem = frame_pointer_rtx; - else - { - tem = hard_frame_pointer_rtx; + if (tem == NULL_RTX) + { + /* For a zero count with __builtin_return_address, we don't care what + frame address we return, because target-specific definitions will + override us. Therefore frame pointer elimination is OK, and using + the soft frame pointer is OK. + + For a nonzero count, or a zero count with __builtin_frame_address, + we require a stable offset from the current frame pointer to the + previous one, so we must use the hard frame pointer, and + we must disable frame pointer elimination. */ + if (count == 0 && fndecl_code == BUILT_IN_RETURN_ADDRESS) + tem = frame_pointer_rtx; + else + { + tem = hard_frame_pointer_rtx; - /* Tell reload not to eliminate the frame pointer. */ - crtl->accesses_prior_frames = 1; + /* Tell reload not to eliminate the frame pointer. */ + crtl->accesses_prior_frames = 1; + } } -#endif /* Some machines need special handling before we can access arbitrary frames. For example, on the SPARC, we must first flush |