[llvm-bugs] [Bug 33492] New: [coroutines] Clang emits duplicate debug information for 'this' variable

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 16 17:35:40 PDT 2017


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

            Bug ID: 33492
           Summary: [coroutines] Clang emits duplicate debug information
                    for 'this' variable
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: eric at efcs.ca
                CC: llvm-bugs at lists.llvm.org

Created attachment 18654
  --> https://bugs.llvm.org/attachment.cgi?id=18654&action=edit
reproducer.cpp

Currently, under certain conditions, Clang/LLVM will hit the following
assertion when processing coroutine code.

clang-5.0: /home/eric/full-llvm/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h:131:
void llvm::DbgVariable::addMMIEntry(const llvm::DbgVariable &): Assertion
`V.Var == Var && "conflicting variable"' failed.

I've only been able to hit this assertion when passing `-g -O2` (See attached
reproducer, compile as "clang++ -std=c++11 -fcoroutines-ts -g -O2 test.cpp").

A little investigation suggests that it's the 'this' variable which is being
duplicated. I have no clue why this is happening.

The relevant bit of the LLVM IR that clang emits appears to be this:

!175 = !DISubprogram(name: "unhandled_exception", linkageName:
"_ZN4func12promise_type19unhandled_exceptionEv", scope: !119, file: !1, line:
106, type: !173, isLocal: false, isDefinition: false, scopeLine: 106, flags:
DIFlagPrototyped, isOptimized: true)
[...]
!178 = !DILocalVariable(name: "this", arg: 1, scope: !179, type: !183, flags:
DIFlagArtificial | DIFlagObjectPointer)
!179 = distinct !DISubprogram(name: "return_void", linkageName:
"_ZN4func12promise_type11return_voidEv", scope: !35, file: !1, line: 105, type:
!93, isLocal: false, isDefinition: true, scopeLine: 105, flags:
DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !92, variables:
!180)
!180 = !{!181}
!181 = !DILocalVariable(name: "this", arg: 1, scope: !179, type: !182, flags:
DIFlagArtificial | DIFlagObjectPointer)
[...]

-- 
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/20170617/b941437b/attachment.html>


More information about the llvm-bugs mailing list