[LLVMbugs] [Bug 18866] New: Debug info for function argument has a wrong span

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Feb 16 23:57:55 PST 2014


            Bug ID: 18866
           Summary: Debug info for function argument has a wrong span
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Core LLVM classes
          Assignee: unassignedbugs at nondot.org
          Reporter: yuri at tsoft.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12077
  --> http://llvm.org/bugs/attachment.cgi?id=12077&action=edit
test case

Please run the script 'run' from the attached test case. Please note the debug
info for the function argument 'xargs' in the file 'x.o.dwarf':
< 2><0x000000c4>      DW_TAG_formal_parameter
                        DW_AT_name                  xargs
                        DW_AT_decl_file             0x00000001
                        DW_AT_decl_line             0x0000026a
                        DW_AT_type                  <0x00000072>
                        DW_AT_location              <loclist with 2 entries
                        [ 0]<lowpc=0x00000010><highpc=0x0000001f>DW_OP_reg5
                        [ 1]<lowpc=0x0000001f><highpc=0x00000021>DW_OP_breg7+0

This debug info says that the xargs argument is valid in the range from
lowpc=0x00000010 to highpc=0x00000021
However, from the file 'x.o.asm' it is obvious that the function itself has the
range 0x0010-0x004b.

So the debug info is wrong because its range is too narrow. The range of the
argument should be equal to the function range 0x0010-0x004b, like for every
function argument in unoptimized code.

Additionally, I have two notes:
Note 1: The DW_AT_location line above shouldn't even mention any ranges, and
should look like this:
DW_AT_location              DW_OP_reg5
This is because in unoptimized code the range of the argument should be equal
to the function range, and its location is originally defined by the ABI, and
there is no reason why -O0 code should change the argument location at all.

Note 2: Curiously, when in the same case -code-model is set to 'default', the
function range actually becomes 0x0010-0x0021, and the same debug info becomes
valid. This may be a coincidence.

rev.201464 amd64

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/20140217/513d0f6c/attachment.html>

More information about the llvm-bugs mailing list