aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1993-03-02 13:10:49 -0800
committerJim Wilson <wilson@gcc.gnu.org>1993-03-02 13:10:49 -0800
commit46b68a3769fb5e5d0f18f7ef9211ce43274b08d2 (patch)
treefae1e4f63305d64dd2b4c7f9e8fe740c1d6ef215 /gcc
parent953fe17998caade318c6a8fa25b4629dc8aa52e1 (diff)
downloadgcc-46b68a3769fb5e5d0f18f7ef9211ce43274b08d2.zip
gcc-46b68a3769fb5e5d0f18f7ef9211ce43274b08d2.tar.gz
gcc-46b68a3769fb5e5d0f18f7ef9211ce43274b08d2.tar.bz2
(expand_builtin, BUILT_IN_FRAME_ADDRESS case): Use new
macros SETUP_FRAME_ADDRESSES and RETURN_ADDR_IN_PREVIOUS_FRAME. From-SVN: r3609
Diffstat (limited to 'gcc')
-rw-r--r--gcc/expr.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 0f63276..aa98632 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -6301,6 +6301,23 @@ expand_builtin (exp, target, subtarget, mode, ignore)
rtx tem = frame_pointer_rtx;
int i;
+ /* Some machines need special handling before we can access arbitrary
+ frames. For example, on the sparc, we must first flush all
+ register windows to the stack. */
+#ifdef SETUP_FRAME_ADDRESSES
+ SETUP_FRAME_ADDRESSES ();
+#endif
+
+ /* 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. */
+#ifdef RETURN_ADDR_IN_PREVIOUS_FRAME
+ if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_RETURN_ADDRESS)
+ count--;
+#endif
+
/* Scan back COUNT frames to the specified frame. */
for (i = 0; i < count; i++)
{