summaryrefslogtreecommitdiff
path: root/libgcc/config
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2012-03-31 16:24:04 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-03-31 16:24:04 +0000
commit9a9dcce8e8f235bddcbb89bf6010577686b4627b (patch)
treefda83759f1936ac74f3ccd9fa96c2c489dd575ae /libgcc/config
parent71bb37ba99c71d21d504b91bd0c8904d89f2db58 (diff)
downloadgcc-9a9dcce8e8f235bddcbb89bf6010577686b4627b.tar.gz
unwind-ia64.c (uw_install_context): Manually save LC if it hasn't been previously saved.
* config/ia64/unwind-ia64.c (uw_install_context): Manually save LC if it hasn't been previously saved. From-SVN: r186045
Diffstat (limited to 'libgcc/config')
-rw-r--r--libgcc/config/ia64/unwind-ia64.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libgcc/config/ia64/unwind-ia64.c b/libgcc/config/ia64/unwind-ia64.c
index 10cf1363b1b..2bb9100a499 100644
--- a/libgcc/config/ia64/unwind-ia64.c
+++ b/libgcc/config/ia64/unwind-ia64.c
@@ -2169,8 +2169,20 @@ uw_install_context (struct _Unwind_Context *current __attribute__((unused)),
struct _Unwind_Context *target)
{
unw_word ireg_buf[4], ireg_nat = 0, ireg_pr = 0;
+ unw_word saved_lc;
int i;
+ /* ??? LC is a fixed register so the call to __builtin_unwind_init in
+ uw_init_context doesn't cause it to be saved. In case it isn't in
+ the user frames either, we need to manually do so here, lest it be
+ clobbered by the loop just below. */
+ if (target->lc_loc == NULL)
+ {
+ register unw_word lc asm ("ar.lc");
+ saved_lc = lc;
+ target->lc_loc = &saved_lc;
+ }
+
/* Copy integer register data from the target context to a
temporary buffer. Do this so that we can frob AR.UNAT
to get the NaT bits for these registers set properly. */