[LLVMbugs] [Bug 19001] New: Attribute 'nodebug' disables line information when inlined

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Feb 28 00:03:36 PST 2014


            Bug ID: 19001
           Summary: Attribute 'nodebug' disables line information when
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: eugeni.stepanov at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ cat nodebug.cc
__attribute__((__always_inline__, __nodebug__))
static int f(int x) {
        return __builtin_bswap32(x);

int main() {
        return f(0);

$ ./bin/clang++ nodebug.cc -O0 -g -S -emit-llvm -o -
define i32 @main() #0 {
  %x.addr.i = alloca i32, align 4
  %retval = alloca i32, align 4
  store i32 0, i32* %retval
  store i32 0, i32* %x.addr.i, align 4
  %0 = load i32* %x.addr.i, align 4
  %1 = call i32 @llvm.bswap.i32(i32 %0) #2
  ret i32 %1, !dbg !12

Instructions that are inlined from f are missing debug annotations.
I expect them to have line/column information from the call site (i.e. main()
The way it is done now, binary code emitted for these instructions is assigned
line numbers from the preceding instructions, which is unstable in respect to
code moving optimizations.

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/20140228/3caa1fbe/attachment.html>

More information about the llvm-bugs mailing list