Hi,

when creating the fallback framestate for unwinding through a signal
frame we currently use a linear mapping from the hard regs to dwarf
regs also for FPRs.  This is wrong.  In order to deal with FPR
register pairs as required by the hardware there is a specific mapping
defined in the ABI which we have to take into account here.

I've committed the patch after successful regtest.

This fixes some Java failures which I can only reproduce with another
patch.

Bye,

-Andreas-

2013-07-23  Andreas Krebbel  <andreas.kreb...@de.ibm.com>

        * config/s390/linux-unwind.h: Use the proper dwarf to hard reg
        mapping for FPRs when creating the fallback framestate.

---
 libgcc/config/s390/linux-unwind.h |    4 ++!!
 1 file changed, 2 insertions(+), 2 modifications(!)

Index: libgcc/config/s390/linux-unwind.h
===================================================================
*** libgcc/config/s390/linux-unwind.h.orig
--- libgcc/config/s390/linux-unwind.h
*************** static _Unwind_Reason_Code
*** 31,36 ****
--- 31,38 ----
  s390_fallback_frame_state (struct _Unwind_Context *context,
                           _Unwind_FrameState *fs)
  {
+   static const unsigned char dwarf_to_fpr_map[16] =
+     { 0, 2, 4, 6, 1, 3, 5, 7, 8, 10, 12, 14, 9, 11, 13, 15 };
    unsigned char *pc = context->ra;
    long new_cfa;
    int i;
*************** s390_fallback_frame_state (struct _Unwin
*** 112,118 ****
      {
        fs->regs.reg[16+i].how = REG_SAVED_OFFSET;
        fs->regs.reg[16+i].loc.offset =
!       (long)&regs->fprs[i] - new_cfa;
      }
  
    /* Load return addr from PSW into dummy register 32.  */
--- 114,120 ----
      {
        fs->regs.reg[16+i].how = REG_SAVED_OFFSET;
        fs->regs.reg[16+i].loc.offset =
!       (long)&regs->fprs[dwarf_to_fpr_map[i]] - new_cfa;
      }
  
    /* Load return addr from PSW into dummy register 32.  */

Reply via email to