[llvm-bugs] [Bug 25630] New: No inline debug info generated for small functions when optimizing

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 24 13:49:15 PST 2015


https://llvm.org/bugs/show_bug.cgi?id=25630

            Bug ID: 25630
           Summary: No inline debug info generated for small functions
                    when optimizing
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dnovillo at google.com
                CC: danielcdh at gmail.com, dblaikie at gmail.com,
                    echristo at gmail.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15349
  --> https://llvm.org/bugs/attachment.cgi?id=15349&action=edit
Test case

For one liner functions, LLVM seems to not be emitting inlined-at information
in the final binary.  The inlinedAt tags are there in the bytecode, but don't
show up in the final binary.

If I change the code of the inlined function to have more than one line, then
the inlinedAt markers survive to the final binary.

$ clang++ -O2 -g bug.cc -o bug
$ llvm-dwarfdump --debug-dump=info bug|grep -A6 DW_TAG_inlined_subroutine

When compiled with GCC, the inlined function is marked properly:

$ g++-4.9 -O2 -g bug.cc -o gcc-bug
$ llvm-dwarfdump --debug-dump=info gcc-bug|grep -A6 DW_TAG_inlined_subroutine
0x00000476:       DW_TAG_inlined_subroutine [21] *
                    DW_AT_abstract_origin [DW_FORM_ref4]        (cu + 0x028d =>
{0x000003da} "_Z3sumxx")
                    DW_AT_low_pc [DW_FORM_addr] (0x0000000000400559)
                    DW_AT_high_pc [DW_FORM_data8]       (0x0000000000000003)
                    DW_AT_call_file [DW_FORM_data1]     ("./bug.cc")
                    DW_AT_call_line [DW_FORM_data1]     (8)
                    DW_AT_GNU_discriminator [DW_FORM_data1]     (0x02)


If I modified the inlined function to have more code, LLVM will generate a
DW_TAG_inlined_subroutine tag.  I did this in the no-bug.cc test case:

$ clang++ -g -O2 no-bug.cc -o no-bug
$ llvm-dwarfdump --debug-dump=info no-bug|grep -A6 DW_TAG_inlined_subroutine
0x000000b1:     DW_TAG_inlined_subroutine [9] *
                  DW_AT_abstract_origin [DW_FORM_ref4]  (cu + 0x004c =>
{0x0000004c} "_Z3sumxx")
                  DW_AT_low_pc [DW_FORM_addr]   (0x000000000040063e)
                  DW_AT_high_pc [DW_FORM_data4] (0x00000010)
                  DW_AT_call_file [DW_FORM_data1]       ("./no-bug.cc")
                  DW_AT_call_line [DW_FORM_data1]       (13)
                  DW_AT_GNU_discriminator [DW_FORM_data1]       (0x01)

-- 
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/20151124/55d2bc95/attachment.html>


More information about the llvm-bugs mailing list