This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: var-tracking wrt. leaf regs on sparc


From: Jakub Jelinek <jakub@redhat.com>
Date: Thu, 7 Feb 2013 18:22:32 +0100

> Then supposedly somewhere in dwarf2out we do some adjustment,
> but still end up with d/e loclist of:
> .LLST2:
>         .uaxword        .LVL0-.Ltext0   ! Location list begin address (*.LLST2)
>         .uaxword        .LVL1-.Ltext0   ! Location list end address (*.LLST2)
>         .uahalf 0x6     ! Location expression size
>         .byte   0x88    ! DW_OP_breg24
>         .byte   0       ! sleb128 0
>         .byte   0x89    ! DW_OP_breg25
>         .byte   0       ! sleb128 0
>         .byte   0x22    ! DW_OP_plus
>         .byte   0x9f    ! DW_OP_stack_value
>         .uaxword        .LVL1-.Ltext0   ! Location list begin address (*.LLST2)
>         .uaxword        .LFE0-.Ltext0   ! Location list end address (*.LLST2)
>         .uahalf 0x1     ! Location expression size
>         .byte   0x58    ! DW_OP_reg8
>         .uaxword        0       ! Location list terminator begin (*.LLST2)
>         .uaxword        0       ! Location list terminator end (*.LLST2)
> where I'd expect breg8/breg9 instead.

The fix for this is trivial, just a missing leaf renumbering in dwarf2out.c:

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 06cfb18..765d5c5 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -10864,7 +10864,16 @@ based_loc_descr (rtx reg, HOST_WIDE_INT offset,
 	}
     }
 
-  regno = DWARF_FRAME_REGNUM (REGNO (reg));
+  regno = REGNO (reg);
+#ifdef LEAF_REG_REMAP
+  if (crtl->uses_only_leaf_regs)
+    {
+      int leaf_reg = LEAF_REG_REMAP (regno);
+      if (leaf_reg != -1)
+	regno = (unsigned) leaf_reg;
+    }
+#endif
+  regno = DWARF_FRAME_REGNUM (regno);
 
   if (!optimize && fde
       && (fde->drap_reg == regno || fde->vdrap_reg == regno))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]