aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2004-08-09 20:31:41 +0000
committerPaul Brook <pbrook@gcc.gnu.org>2004-08-09 20:31:41 +0000
commit9d8646d7b098cd131bd9263ec98d3c03bdf4f66b (patch)
treeb22213fcc797d974ef0d6a219a5158d5efb1523f /gcc
parentd37e6b50362c82ee6bcb630a949e7e38830901ba (diff)
downloadgcc-9d8646d7b098cd131bd9263ec98d3c03bdf4f66b.zip
gcc-9d8646d7b098cd131bd9263ec98d3c03bdf4f66b.tar.gz
gcc-9d8646d7b098cd131bd9263ec98d3c03bdf4f66b.tar.bz2
unwind-dw2.c (uw_install_context_1): Update target saved stack pointer.
* unwind-dw2.c (uw_install_context_1): Update target saved stack pointer. Co-Authored-By: Richard Henderson <rth@redhat.com> From-SVN: r85723
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/unwind-dw2.c35
2 files changed, 25 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8ce8ab9..ee1cbd7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2004-08-09 Paul Brook <paul@codesourcery.com>
+ Richard Henderson <rth@redhat.com>
+
+ * unwind-dw2.c (uw_install_context_1): Update target saved stack
+ pointer.
+
2004-08-09 Geoffrey Keating <geoffk@apple.com>
* ggc-common.c (ggc_rlimit_bound): Don't check RSS limit.
diff --git a/gcc/unwind-dw2.c b/gcc/unwind-dw2.c
index 11b94b1..8b60b0c 100644
--- a/gcc/unwind-dw2.c
+++ b/gcc/unwind-dw2.c
@@ -1274,6 +1274,12 @@ uw_install_context_1 (struct _Unwind_Context *current,
struct _Unwind_Context *target)
{
long i;
+ _Unwind_SpTmp sp_slot;
+
+ /* If the target frame does not have a saved stack pointer,
+ then set up the target's CFA. */
+ if (!_Unwind_GetGRPtr (target, __builtin_dwarf_sp_column ()))
+ _Unwind_SetSpColumn (target, target->cfa, &sp_slot);
for (i = 0; i < DWARF_FRAME_REGISTERS; ++i)
{
@@ -1284,25 +1290,22 @@ uw_install_context_1 (struct _Unwind_Context *current,
memcpy (c, t, dwarf_reg_size_table[i]);
}
-#ifdef EH_RETURN_STACKADJ_RTX
- {
- void *target_cfa;
+ /* If the current frame doesn't have a saved stack pointer, then we
+ need to rely on EH_RETURN_STACKADJ_RTX to get our target stack
+ pointer value reloaded. */
+ if (!_Unwind_GetGRPtr (current, __builtin_dwarf_sp_column ()))
+ {
+ void *target_cfa;
- /* If the last frame records a saved stack pointer, use it. */
- if (_Unwind_GetGRPtr (target, __builtin_dwarf_sp_column ()))
target_cfa = _Unwind_GetPtr (target, __builtin_dwarf_sp_column ());
- else
- target_cfa = target->cfa;
-
- /* We adjust SP by the difference between CURRENT and TARGET's CFA. */
- if (STACK_GROWS_DOWNWARD)
- return target_cfa - current->cfa + target->args_size;
- else
- return current->cfa - target_cfa - target->args_size;
- }
-#else
+
+ /* We adjust SP by the difference between CURRENT and TARGET's CFA. */
+ if (STACK_GROWS_DOWNWARD)
+ return target_cfa - current->cfa + target->args_size;
+ else
+ return current->cfa - target_cfa - target->args_size;
+ }
return 0;
-#endif
}
static inline _Unwind_Ptr