[llvm-bugs] [Bug 35270] New: [coroutines] assertion (Block[UseIndex].Consumes[DefIndex] && "use must consume def") with __attribute__((always_inline))

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 9 20:21:43 PST 2017


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

            Bug ID: 35270
           Summary: [coroutines] assertion
                    (Block[UseIndex].Consumes[DefIndex] && "use must
                    consume def") with __attribute__((always_inline))
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: eniebler at boost.org
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

Created attachment 19399
  --> https://bugs.llvm.org/attachment.cgi?id=19399&action=edit
repro

Compile attached file as:
clang++ -std=gnu++2a -fcoroutines-ts -c test.cpp

Removing the one instance of __attribute__((__always_inline__)) eliminates the
error.


Assertion failed: (Block[UseIndex].Consumes[DefIndex] && "use must consume
def"), function hasPathCrossingSuspendPoint, file
/Users/eniebler/llvm/lib/Transforms/Coroutines/CoroFrame.cpp, line 106.
0  clang-6.0                0x0000000103b01e0c
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 60
1  clang-6.0                0x0000000103b02409
PrintStackTraceSignalHandler(void*) + 25
2  clang-6.0                0x0000000103afdc69 llvm::sys::RunSignalHandlers() +
425
3  clang-6.0                0x0000000103b027c2 SignalHandler(int) + 354
4  libsystem_platform.dylib 0x00007fffae360b3a _sigtramp + 26
5  clang-6.0                0x0000000100c32c05
llvm::isa_impl<llvm::Instruction, llvm::Value, void>::doit(llvm::Value const&)
+ 21
6  libsystem_c.dylib        0x00007fffae1e5420 abort + 129
7  libsystem_c.dylib        0x00007fffae1ac893 basename_r + 0
8  clang-6.0                0x0000000105078dae (anonymous
namespace)::SuspendCrossingInfo::hasPathCrossingSuspendPoint(llvm::BasicBlock*,
llvm::BasicBlock*) const + 366
9  clang-6.0                0x0000000105078c22 (anonymous
namespace)::SuspendCrossingInfo::isDefinitionAcrossSuspend(llvm::BasicBlock*,
llvm::User*) const + 130
10 clang-6.0                0x0000000105074868 (anonymous
namespace)::SuspendCrossingInfo::isDefinitionAcrossSuspend(llvm::Instruction&,
llvm::User*) const + 56
11 clang-6.0                0x000000010507410d
llvm::coro::buildCoroutineFrame(llvm::Function&, llvm::coro::Shape&) + 2221
12 clang-6.0                0x000000010507b0a3 splitCoroutine(llvm::Function&,
llvm::CallGraph&, llvm::CallGraphSCC&) + 147
13 clang-6.0                0x000000010507a881 (anonymous
namespace)::CoroSplit::runOnSCC(llvm::CallGraphSCC&) + 1937
14 clang-6.0                0x00000001023953df (anonymous
namespace)::CGPassManager::RunPassOnSCC(llvm::Pass*, llvm::CallGraphSCC&,
llvm::CallGraph&, bool&, bool&) + 255
15 clang-6.0                0x0000000102393db9 (anonymous
namespace)::CGPassManager::RunAllPassesOnSCC(llvm::CallGraphSCC&,
llvm::CallGraph&, bool&) + 1561
16 clang-6.0                0x00000001023931a3 (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&) + 419
17 clang-6.0                0x0000000102f34ee4 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&) + 2196
18 clang-6.0                0x0000000102f343d6
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 342
19 clang-6.0                0x0000000102f35c11
llvm::legacy::PassManager::run(llvm::Module&) + 33
20 clang-6.0                0x0000000103f27c03 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::__1::unique_ptr<llvm::raw_pwrite_stream,
std::__1::default_delete<llvm::raw_pwrite_stream> >) + 4771
21 clang-6.0                0x0000000103f220b2
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions
const&, clang::CodeGenOptions const&, clang::TargetOptions const&,
clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*,
clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream,
std::__1::default_delete<llvm::raw_pwrite_stream> >) + 4450
22 clang-6.0                0x00000001042fc1ba
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 5562
23 clang-6.0                0x000000010617eb26 clang::ParseAST(clang::Sema&,
bool, bool) + 1238
24 clang-6.0                0x0000000104a3f295
clang::ASTFrontendAction::ExecuteAction() + 485
25 clang-6.0                0x00000001042f9fba
clang::CodeGenAction::ExecuteAction() + 5546
26 clang-6.0                0x0000000104a3e1f0 clang::FrontendAction::Execute()
+ 112
27 clang-6.0                0x00000001049537ad
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 2285
28 clang-6.0                0x0000000104af26a3
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 5843
29 clang-6.0                0x0000000100a51284 cc1_main(llvm::ArrayRef<char
const*>, char const*, void*) + 4900
30 clang-6.0                0x0000000100a4020e
ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) + 622
31 clang-6.0                0x0000000100a3d8aa main + 4282
32 libdyld.dylib            0x00007fffae151235 start + 1
33 libdyld.dylib            0x0000000000000038 start + 1374350852
Stack dump:
0.      Program arguments: /Users/eniebler/llvm-install/bin/clang-6.0 -cc1
-triple x86_64-apple-macosx10.12.0 -Wdeprecated-objc-isa-usage
-Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free
-main-file-name test.cpp -mrelocation-model pic -pic-level 2 -mthread-model
posix -mdisable-fp-elim -masm-verbose -munwind-tables
-faligned-alloc-unavailable -target-cpu penryn -dwarf-column-info
-debugger-tuning=lldb -target-linker-version 302.3 -coverage-notes-file
/Users/eniebler/test.gcno -resource-dir
/Users/eniebler/llvm-install/lib/clang/6.0.0 -stdlib=libc++ -std=gnu++2a
-fdeprecated-macro -fdebug-compilation-dir /Users/eniebler -ferror-limit 19
-fmessage-length 183 -stack-protector 1 -fblocks
-fencode-extended-block-signature -fcoroutines-ts -fobjc-runtime=macosx-10.12.0
-fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option
-fcolor-diagnostics -o test.o -x c++ test.cpp
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'CallGraph Pass Manager' on module 'test.cpp'.
clang-6.0: error: unable to execute command: Abort trap: 6
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (http://llvm.org/git/clang.git
a5d15d15a4534ca7e221af8f7bc421300ae0e4a2) (http://llvm.org/git/llvm.git
d90f53e14ab206e2903596f3cf679b70a2a5babc)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Users/eniebler/./llvm-install/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-6.0: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-6.0: note: diagnostic msg:
/var/folders/0_/77jy5prn181b5wn2xzl1cbfc18wy7r/T/test-1a7d12.cpp
clang-6.0: note: diagnostic msg:
/var/folders/0_/77jy5prn181b5wn2xzl1cbfc18wy7r/T/test-1a7d12.sh
clang-6.0: note: diagnostic msg: Crash backtrace is located in
clang-6.0: note: diagnostic msg:
/Users/eniebler/Library/Logs/DiagnosticReports/clang-6.0_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang-6.0: note: diagnostic msg: (choose the .crash file that corresponds to
your crash)
clang-6.0: note: diagnostic msg:

********************

-- 
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/20171110/120857a1/attachment-0001.html>


More information about the llvm-bugs mailing list