[LLVMbugs] [Bug 13317] New: Debug information for inline constructor not proper.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 10 01:33:37 PDT 2012


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

             Bug #: 13317
           Summary: Debug information for inline constructor not proper.
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: karthikthecool at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


In case of inline default constructor debug information in wrongly generated.
For e.g. for the below code-

class Apple
{
public:
 Apple ()
    {
      int b = 0;
    }
};

int
main (void)
{
  Apple b;
  return 0;
}


Debug info for the default constructor in the assembly is as follows contains 2
entries i.e.


_ZN5AppleC1Ev:
.Lfunc_begin1:
    .loc    2 5 0                   
@ BB#0:                                 @ %entry
    push    {r7, lr}
    mov    r7, sp
    sub    sp, #24
    str    r0, [sp, #16]
    str    r0, [sp, #20]
    sub    sp, #4
    .loc    2 7 2 prologue_end      
.Ltmp3:
    str    r0, [sp, #12]           @ 4-byte Spill
    bl    _ZN5AppleC2Ev(PLT)
    ldr    r1, [sp, #20]
    ldr    r2, [sp, #12]           @ 4-byte Reload
    str    r0, [sp, #8]            @ 4-byte Spill
    mov    r0, r1
    str    r2, [sp, #4]            @ 4-byte Spill
    add    sp, #28
    pop    {r7, pc}
.Ltmp4:
.Ltmp5:
    .size    _ZN5AppleC1Ev, .Ltmp5-_ZN5AppleC1Ev
.Lfunc_end1:

    .section    .text._ZN5AppleC2Ev,"axG",%progbits,_ZN5AppleC2Ev,comdat
    .weak    _ZN5AppleC2Ev
    .align    2
    .type    _ZN5AppleC2Ev,%function
    .code    16                      @ @_ZN5AppleC2Ev
    .thumb_func


_ZN5AppleC2Ev:
.Lfunc_begin2:
    .loc    2 5 0                   
@ BB#0:                                 @ %entry
    sub    sp, #16
    @DEBUG_VALUE: Apple:this <- undef
    str    r0, [sp, #8]
    str    r0, [sp, #12]
    movs    r1, #0
    sub    sp, #4
    .loc    2 6 16 prologue_end     
.Ltmp6:
    str    r1, [sp, #4]
    .loc    2 7 2                   
    ldr    r1, [sp, #12]
    str    r0, [sp]                @ 4-byte Spill
    mov    r0, r1
    add    sp, #20
    bx    lr
.Ltmp7:
.Ltmp8:
    .size    _ZN5AppleC2Ev, .Ltmp8-_ZN5AppleC2Ev
.Lfunc_end2:




As shown in the assembly snippet. For the default constructor we get 2 entries
one by name _ZN5AppleC1Ev and another by _ZN5AppleC2Ev.

-- 
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