[LLVMbugs] [Bug 12678] New: incorrect debugging information generated for simple program

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 26 14:25:46 PDT 2012


             Bug #: 12678
           Summary: incorrect debugging information generated for simple
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: matt at pharr.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 8462
  --> http://llvm.org/bugs/attachment.cgi?id=8462

See the attached bitcode file, which represents compiling this program with
clang with -g enabled.

float foo() {
    float r = 0;
    r = 1;
    r *= 3;
    return r;

If I link an executable like this:

% llc -filetype=obj -o bug.o bug.ll && clang main.cpp bug.o

and run it in the debugger (both gdb 6.3.50-20050815 (Apple version gdb-1708)
and lldb), I can set a breakpoint in foo() and print the value of r correctly
as I step through foo.

However, if you comment out this line in the bitcode file:

;;  %internal_mask_memory = alloca <8 x i32>

and recompile and link as above, if you step through foo(), bogus values are
printed for the value of r.  (gdb consistently prints 0, and lldb prints
4.59163e-41, on my system at least.)  Note that the value allocated here is
totally unused.

dwarfdump only prints minor differences between the object files that llc
generates: one has rsp as the AT_frame_base and the other rbp, and the
AT_locations for "r" are different, but in both cases seem correct from an
eyeballing of the assembly.

(So I have no good clues/theories about where things are going wrong,

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