linux-unwind.h: Use the proper dwarf to hard reg mapping for FPRs when...
authorAndreas Krebbel <Andreas.Krebbel@de.ibm.com>
Tue, 23 Jul 2013 07:20:52 +0000 (07:20 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Tue, 23 Jul 2013 07:20:52 +0000 (07:20 +0000)
2013-07-23  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

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

From-SVN: r201156

libgcc/ChangeLog
libgcc/config/s390/linux-unwind.h

index 9020a64394637858d48c39bbd45321d4ad575b61..78700d7a15c8ddadf42d6a847f4567fa28930cb9 100644 (file)
@@ -1,3 +1,8 @@
+2013-07-23  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
+       * config/s390/linux-unwind.h: Use the proper dwarf to hard reg
+       mapping for FPRs when creating the fallback framestate.
+
 2013-07-19  Georg-Johann Lay  <avr@gjlay.de>
 
        PR target/57516
index e497ce38d3ac1a7d71d2f524e3cefb854cbb3591..686091697072775f821b5580a263e17f1ba63df4 100644 (file)
@@ -31,6 +31,8 @@ static _Unwind_Reason_Code
 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;
@@ -112,7 +114,7 @@ s390_fallback_frame_state (struct _Unwind_Context *context,
     {
       fs->regs.reg[16+i].how = REG_SAVED_OFFSET;
       fs->regs.reg[16+i].loc.offset =
-       (long)&regs->fprs[i] - new_cfa;
+       (long)&regs->fprs[dwarf_to_fpr_map[i]] - new_cfa;
     }
 
   /* Load return addr from PSW into dummy register 32.  */