[LLVMbugs] [Bug 22762] New: DW_AT_frame_base with frame register isn't encoded with DW_OP_fbreg

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 2 14:47:51 PST 2015


http://llvm.org/bugs/show_bug.cgi?id=22762

            Bug ID: 22762
           Summary: DW_AT_frame_base with frame register isn't encoded
                    with DW_OP_fbreg
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: hjl.tools at gmail.com
                CC: llvmbugs at cs.uiuc.edu, michael.m.kuperstein at intel.com
    Classification: Unclassified

Created attachment 13978
  --> http://llvm.org/bugs/attachment.cgi?id=13978&action=edit
A testcase

DwarfExpression::AddMachineRegIndirect in DwarfExpression.cpp has

bool DwarfExpression::AddMachineRegIndirect(unsigned MachineReg, int Offset) {
  int DwarfReg = getTRI()->getDwarfRegNum(MachineReg, false);
  if (DwarfReg < 0)
    return false;

  if (isFrameRegister(MachineReg)) {
    // If variable offset is based in frame register then use fbreg.
    EmitOp(dwarf::DW_OP_fbreg);
    EmitSigned(Offset);
  } else {
    AddRegIndirect(DwarfReg, Offset);
  }
  return true;
}

X32 uses EBP as frame register and EBP doesn't map to a DWARF register
number.  But frame register is special, which should be mapped to
DW_OP_fbreg, regardless its DWARF register number.  The check of
DwarfReg < 0 should be moved after if (isFrameRegister(MachineReg))
check.

./llc -mtriple=x86_64-pc-linux-gnux32 -filetype=obj -o x.o x.ll
readelf -w x.o | grep DW_AT_frame_base
    <2b>   DW_AT_frame_base  : 3 byte block: 56 93 4     (DW_OP_reg6 (rbp);
DW_OP_piece: 4)
    DW_AT_frame_base   DW_FORM_exprloc

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150302/75f1457d/attachment.html>


More information about the llvm-bugs mailing list