[LLVMbugs] [Bug 11345] New: debug info generated for functions that are not emitted

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 8 17:44:51 PST 2011


             Bug #: 11345
           Summary: debug info generated for functions that are not
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: echristo at gmail.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Consider this testcase:

  class locale {
    void _M_add_reference() const throw() {
  class ios_base {
    locale _M_ios_locale;
    class Init {
  static ios_base::Init __ioinit;

When built without debug info, GCC and clang agree, the resulting assembly is:
        .local  _ZL8__ioinit
        .comm   _ZL8__ioinit,1,1

but where things get exciting is the debug info. Besides the
filename/directory/compiler identifier, the strings that GCC emits are

        .string "Init"
        .string "__ioinit"

which makes sense, there's one object named __ioinit of type Init (technically
"ios_base::Init", so emitting that would be fine too). Clang emits:

        .ascii   "__ioinit"
        .zero   1
        .ascii   "_ZL8__ioinit"
        .zero   1
        .ascii   "Init"
        .zero   1
        .ascii   "_M_ios_locale"
        .zero   1
        .ascii   "_ZNK6locale16_M_add_referenceEv"
        .zero   1
        .ascii   "_M_add_reference"
        .zero   1
        .ascii   "locale"
        .zero   1
        .ascii   "ios_base"
        .zero   1

Yow! We never emitted code for any of those functions at the very least. My
estimate is that this is causing about 60% of the extra strings. (Only an
estimate because there are other sources of differences, such as clang emitting
all case names for a given enum, while gcc only emits the used ones. I consider
clang's behaviour better.)

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list