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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to