From 5ce05e1772da06fcdde791cdd280f7866d4cd640 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 22 Oct 2007 04:00:06 +0200 Subject: [PATCH] linux-unwind.h (ppc_fallback_frame_state): Point saved CR2 offset to low 32 bits of regs->ccr rather than the whole 64-bit... * config/rs6000/linux-unwind.h (ppc_fallback_frame_state): Point saved CR2 offset to low 32 bits of regs->ccr rather than the whole 64-bit register in 64-bit libgcc. From-SVN: r129547 --- gcc/ChangeLog | 6 ++++++ gcc/config/rs6000/linux-unwind.h | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 03142ec03d75..bacaff70f436 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-10-20 Jakub Jelinek + + * config/rs6000/linux-unwind.h (ppc_fallback_frame_state): Point + saved CR2 offset to low 32 bits of regs->ccr rather than the whole + 64-bit register in 64-bit libgcc. + 2007-09-23 H.J. Lu * configure.ac (ld_vers): Support GNU linker version xx.xx.* diff --git a/gcc/config/rs6000/linux-unwind.h b/gcc/config/rs6000/linux-unwind.h index 6e822bde0e2a..3e931030d599 100644 --- a/gcc/config/rs6000/linux-unwind.h +++ b/gcc/config/rs6000/linux-unwind.h @@ -264,7 +264,10 @@ ppc_fallback_frame_state (struct _Unwind_Context *context, } fs->regs.reg[CR2_REGNO].how = REG_SAVED_OFFSET; - fs->regs.reg[CR2_REGNO].loc.offset = (long) ®s->ccr - new_cfa; + /* CR? regs are always 32-bit and PPC is big-endian, so in 64-bit + libgcc loc.offset needs to point to the low 32 bits of regs->ccr. */ + fs->regs.reg[CR2_REGNO].loc.offset = (long) ®s->ccr - new_cfa + + sizeof (long) - 4; fs->regs.reg[LINK_REGISTER_REGNUM].how = REG_SAVED_OFFSET; fs->regs.reg[LINK_REGISTER_REGNUM].loc.offset = (long) ®s->link - new_cfa; -- 2.47.2