From 6c760a694b0acc7076227d86296b8487bae6aae8 Mon Sep 17 00:00:00 2001 From: ebotcazou Date: Sat, 31 Mar 2012 16:24:04 +0000 Subject: [PATCH] * config/ia64/unwind-ia64.c (uw_install_context): Manually save LC if it hasn't been previously saved. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186045 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgcc/ChangeLog | 5 +++++ libgcc/config/ia64/unwind-ia64.c | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index f44f52e..0adcc5a 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2012-03-31 Eric Botcazou + + * config/ia64/unwind-ia64.c (uw_install_context): Manually save LC + if it hasn't been previously saved. + 2012-03-29 H.J. Lu * config/i386/linux-unwind.h (x86_64_fallback_frame_state): Define diff --git a/libgcc/config/ia64/unwind-ia64.c b/libgcc/config/ia64/unwind-ia64.c index 10cf136..2bb9100 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. */ -- 2.7.4