aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@libertysurf.fr>2006-10-03 18:25:00 +0200
committerEric Botcazou <ebotcazou@gcc.gnu.org>2006-10-03 16:25:00 +0000
commit224869d958a293df8b87d4d9ba12e29583de427d (patch)
tree7524af2493029b414c53a5f841468ff3297a46a7 /gcc/builtins.c
parentf0d1d9711d0186439c7c5491b3d9f90d8f4816fc (diff)
downloadgcc-224869d958a293df8b87d4d9ba12e29583de427d.zip
gcc-224869d958a293df8b87d4d9ba12e29583de427d.tar.gz
gcc-224869d958a293df8b87d4d9ba12e29583de427d.tar.bz2
builtins.c (expand_builtin_return_addr): Deal with FRAME_ADDR_RTX.
* builtins.c (expand_builtin_return_addr): Deal with FRAME_ADDR_RTX. * doc/tm.texi (Basic Stack Layout): Document FRAME_ADDR_RTX. * config/sparc/sparc.h (FRAME_ADDR_RTX): Define. From-SVN: r117403
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 8fb58ca..2c81983 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -558,14 +558,14 @@ expand_builtin_return_addr (enum built_in_function fndecl_code, int count)
#endif
/* Some machines need special handling before we can access
- arbitrary frames. For example, on the sparc, we must first flush
+ arbitrary frames. For example, on the SPARC, we must first flush
all register windows to the stack. */
#ifdef SETUP_FRAME_ADDRESSES
if (count > 0)
SETUP_FRAME_ADDRESSES ();
#endif
- /* On the sparc, the return address is not in the frame, it is in a
+ /* On the SPARC, the return address is not in the frame, it is in a
register. There is no way to access it off of the current frame
pointer, but it can be accessed off the previous frame pointer by
reading the value from the register window save area. */
@@ -587,12 +587,16 @@ expand_builtin_return_addr (enum built_in_function fndecl_code, int count)
tem = copy_to_reg (tem);
}
- /* For __builtin_frame_address, return what we've got. */
+ /* For __builtin_frame_address, return what we've got. But, on
+ the SPARC for example, we may have to add a bias. */
if (fndecl_code == BUILT_IN_FRAME_ADDRESS)
+#ifdef FRAME_ADDR_RTX
+ return FRAME_ADDR_RTX (tem);
+#else
return tem;
+#endif
- /* For __builtin_return_address, Get the return address from that
- frame. */
+ /* For __builtin_return_address, get the return address from that frame. */
#ifdef RETURN_ADDR_RTX
tem = RETURN_ADDR_RTX (count, tem);
#else