commit 493c8b15aaa5461e7e152227d58c1a6ed285225b
Author: Olivier Hainque <hainque@adacore.com>
Date:   Wed Nov 19 12:12:13 2014 +0100

    Honor DWARF_REG_TO_UNWIND_COLUMN in dwarf_reg_size_table init
    
            libgcc/
            * unwind-dw2.c (DWARF_REG_TO_UNWIND_COLUMN): Move default def to ...
    
            gcc/
            * defaults.h: ... here.
            * dwarf2cfi.c (init_one_dwarf_reg_size): Honor
            DWARF_REG_TO_UNWIND_COLUMN.

diff --git a/gcc/defaults.h b/gcc/defaults.h
index d2609e7..26e5750b 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -438,6 +438,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define DWARF_FRAME_REGNUM(REG) DBX_REGISTER_NUMBER (REG)
 #endif
 
+/* The mapping from dwarf CFA reg number to internal dwarf reg numbers.  */
+#ifndef DWARF_REG_TO_UNWIND_COLUMN
+#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
+#endif
+
 /* Map register numbers held in the call frame info that gcc has
    collected using DWARF_FRAME_REGNUM to those that should be output in
    .debug_frame and .eh_frame.  */
diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
index 7998871..e9b39d4 100644
--- a/gcc/dwarf2cfi.c
+++ b/gcc/dwarf2cfi.c
@@ -286,8 +286,9 @@ void init_one_dwarf_reg_size (int regno, machine_mode regmode,
 {
   const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
   const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
+  const unsigned int dcol = DWARF_REG_TO_UNWIND_COLUMN (rnum);
   
-  const HOST_WIDE_INT slotoffset = rnum * GET_MODE_SIZE (slotmode);
+  const HOST_WIDE_INT slotoffset = dcol * GET_MODE_SIZE (slotmode);
   const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
 
   /* No point in redoing things if we have processed this register already.
diff --git a/libgcc/unwind-dw2.c b/libgcc/unwind-dw2.c
index e474433..b262fd9 100644
--- a/libgcc/unwind-dw2.c
+++ b/libgcc/unwind-dw2.c
@@ -55,10 +55,6 @@
 #define PRE_GCC3_DWARF_FRAME_REGISTERS __LIBGCC_DWARF_FRAME_REGISTERS__
 #endif
 
-#ifndef DWARF_REG_TO_UNWIND_COLUMN
-#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
-#endif
-
 /* ??? For the public function interfaces, we tend to gcc_assert that the
    column numbers are in range.  For the dwarf2 unwind info this does happen,
    although so far in a case that doesn't actually matter.
