| Issue |
107704
|
| Summary |
[Clang] Assertion `E->getOpcode() == BO_Assign && "unexpected binary l-value"' failed.
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
yijan4845
|
Compiler Explorer: [https://godbolt.org/z/ccxeE7exq](https://godbolt.org/z/ccxeE7exq)
Attempting to compile the following program with Clang Assertion Trunk:
```c
typedef union {
_Complex float cf;
long long ll;
} ucf ;
void foo () {
ucf ucf1;
_Complex float cf;
__asm ("" : "=r" (ucf1.ll) : "r" ((cf + 0)));
}
```
Stack dump:
```
clang-20: /root/llvm-project/clang/lib/CodeGen/CGExpr.cpp:5714: clang::CodeGen::LValue clang::CodeGen::CodeGenFunction::EmitBinaryOperatorLValue(const clang::BinaryOperator*): Assertion `E->getOpcode() == BO_Assign && "unexpected binary l-value"' 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-20240907/bin/clang-20 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -dumpdir /app/output.s- -disable-free -clear-ast-before-backend -main-file-name example.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -fno-verbose-asm -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debug-info-kind=constructor -dwarf-version=4 -debugger-tuning=gdb -fdebug-compilation-dir=/app -fcoverage-compilation-dir=/app -resource-dir /opt/compiler-explorer/clang-assertions-trunk-20240907/lib/clang/20 -internal-isystem /opt/compiler-explorer/clang-assertions-trunk-20240907/lib/clang/20/include -internal-isystem /usr/local/include -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/example-17b744.o -x c <source>
1. <eof> parser at end of file
2. <source>:6:6: LLVM IR generation of declaration 'foo'
3. <source>:6:6: Generating code for declaration 'foo'
#0 0x0000000003b24fa8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x3b24fa8)
#1 0x0000000003b226ec SignalHandler(int) Signals.cpp:0:0
#2 0x000077a810a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x000077a810a969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x000077a810a42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x000077a810a287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x000077a810a2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#7 0x000077a810a39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#8 0x00000000042f7572 clang::CodeGen::CodeGenFunction::EmitBinaryOperatorLValue(clang::BinaryOperator const*) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x42f7572)
#9 0x00000000042e43b0 clang::CodeGen::CodeGenFunction::EmitLValueHelper(clang::Expr const*, clang::CodeGen::KnownNonNull_t) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x42e43b0)
#10 0x00000000042e4721 clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*, clang::CodeGen::KnownNonNull_t) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x42e4721)
#11 0x0000000003e7a443 clang::CodeGen::CodeGenFunction::EmitAsmInput(clang::TargetInfo::ConstraintInfo const&, clang::Expr const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x3e7a443)
#12 0x0000000003e7ffec clang::CodeGen::CodeGenFunction::EmitAsmStmt(clang::AsmStmt const&) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x3e7ffec)
#13 0x0000000003e860d0 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x3e860d0)
#14 0x0000000003e8db44 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x3e8db44)
#15 0x0000000003ef5764 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x3ef5764)
#16 0x0000000003f07f7f clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x3f07f7f)
#17 0x0000000003f6c09a clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x3f6c09a)
#18 0x0000000003f66f15 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x3f66f15)
#19 0x0000000003f674cb clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x3f674cb)
#20 0x0000000003f71603 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.0) CodeGenModule.cpp:0:0
#21 0x0000000004471816 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) ModuleBuilder.cpp:0:0
#22 0x0000000004461a38 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x4461a38)
#23 0x00000000065ae1c4 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x65ae1c4)
#24 0x000000000446f378 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x446f378)
#25 0x00000000047012b9 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x47012b9)
#26 0x0000000004684b6e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x4684b6e)
#27 0x00000000047ea6de clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0x47ea6de)
#28 0x0000000000cb8fdf cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0xcb8fdf)
#29 0x0000000000cb222a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#30 0x0000000000cb5b5e clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0xcb5b5e)
#31 0x0000000000b88c84 main (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0xb88c84)
#32 0x000077a810a29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#33 0x000077a810a29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#34 0x0000000000cb1cde _start (/opt/compiler-explorer/clang-assertions-trunk-20240907/bin/clang-20+0xcb1cde)
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs