| Issue |
177056
|
| Summary |
[clang] Assertion `SL->isOrdinary()' failed.
|
| Labels |
clang:frontend,
crash-on-invalid,
inline-asm
|
| Assignees |
|
| Reporter |
k-arrows
|
Reproducer:
https://godbolt.org/z/Er4453nsh
```cpp
void foo() {
asm("" ::: (u8""}));
}
```
Backtrace:
```console
clang++: /root/llvm-project/llvm/tools/clang/lib/Sema/SemaStmtAsm.cpp:243: clang::ExprResult clang::Sema::ActOnGCCAsmStmtString(clang::Expr*, bool): Assertion `SL->isOrdinary()' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics <source>
1. <source>:2:19: current parser token '}'
2. <source>:1:12: parsing function body 'foo'
3. <source>:1:12: in compound statement ('{}')
#0 0x0000000004318fd8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4318fd8)
#1 0x0000000004316434 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4316434)
#2 0x0000000004259208 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007d6b08242520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007d6b082969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x00007d6b08242476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x00007d6b082287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x00007d6b0822871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x00007d6b08239e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x00000000073ede82 clang::Sema::ActOnGCCAsmStmtString(clang::Expr*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x73ede82)
#10 0x0000000006a7e7e5 clang::Parser::ParseAsmStringLiteral(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6a7e7e5)
#11 0x0000000006b8c2f3 clang::Parser::ParseAsmStatement(bool&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6b8c2f3)
#12 0x0000000006b79147 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 24u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::LabelDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6b79147)
#13 0x0000000006b79e26 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 24u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::LabelDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6b79e26)
#14 0x0000000006b8276e clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6b8276e)
#15 0x0000000006b82fba clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6b82fba)
#16 0x0000000006a8918b clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6a8918b)
#17 0x0000000006abf5fd clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6abf5fd)
#18 0x0000000006a7c2eb clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6a7c2eb)
#19 0x0000000006a7cadf clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6a7cadf)
#20 0x0000000006a8490a clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6a8490a)
#21 0x0000000006a858a5 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6a858a5)
#22 0x0000000006a85d50 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6a85d50)
#23 0x0000000006a668f3 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6a668f3)
#24 0x0000000004c80b08 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4c80b08)
#25 0x0000000004f7b095 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4f7b095)
#26 0x0000000004efaa6e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4efaa6e)
#27 0x0000000005075e2d clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5075e2d)
#28 0x0000000000ddb63e cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xddb63e)
#29 0x0000000000dd200a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#30 0x0000000000dd218d int llvm::function_ref<int (llvm::SmallVectorImpl<char const*>&)>::callback_fn<clang_main(int, char**, llvm::ToolContext const&)::'lambda'(llvm::SmallVectorImpl<char const*>&)>(long, llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#31 0x0000000004cf4219 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#32 0x00000000042596a4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x42596a4)
#33 0x0000000004cf482f clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#34 0x0000000004cb5202 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4cb5202)
#35 0x0000000004cb61ae clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4cb61ae)
#36 0x0000000004cbd5f5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4cbd5f5)
#37 0x0000000000dd79b1 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xdd79b1)
#38 0x0000000000c94e04 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc94e04)
#39 0x00007d6b08229d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#40 0x00007d6b08229e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#41 0x0000000000dd1aa5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xdd1aa5)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs