Issue |
128532
|
Summary |
Assertion `!rvalue.isAggregate() || rvalue.getAggregateAddress().getElementType() == dest.getAddress().getElementType()' failed
|
Labels |
new issue
|
Assignees |
|
Reporter |
bi6c
|
Compiler Explorer: https://godbolt.org/z/hMrzf6TWj
```console
clang: /root/llvm-project/clang/lib/CodeGen/CGAtomic.cpp:1986: void clang::CodeGen::CodeGenFunction::EmitAtomicStore(clang::CodeGen::RValue, clang::CodeGen::LValue, llvm::AtomicOrdering, bool, bool): Assertion `!rvalue.isAggregate() || rvalue.getAggregateAddress().getElementType() == dest.getAddress().getElementType()' 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 -gdwarf-4 -g -o /app/output.s -fno-verbose-asm -c --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics <source>
1. <eof> parser at end of file
2. Per-file LLVM IR generation
3. <source>:2:13: Generating code for declaration 'test_simple_assign'
#0 0x0000000003e46dd8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e46dd8)
#1 0x0000000003e44a94 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e44a94)
#2 0x0000000003d90ec8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x000079e1f4042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x000079e1f40969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x000079e1f4042476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x000079e1f40287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x000079e1f402871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x000079e1f4039e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x000000000452344f clang::CodeGen::CodeGenFunction::EmitAtomicStore(clang::CodeGen::RValue, clang::CodeGen::LValue, llvm::AtomicOrdering, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x452344f)
#10 0x00000000041c670c (anonymous namespace)::AggExprEmitter::VisitBinAssign(clang::BinaryOperator const*) CGExprAgg.cpp:0:0
#11 0x00000000041c5c4b (anonymous namespace)::AggExprEmitter::Visit(clang::Expr*) CGExprAgg.cpp:0:0
#12 0x00000000041c5571 (anonymous namespace)::AggExprEmitter::Visit(clang::Expr*) CGExprAgg.cpp:0:0
#13 0x00000000041c6260 clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr const*, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x41c6260)
#14 0x00000000041c6af8 (anonymous namespace)::AggExprEmitter::VisitBinAssign(clang::BinaryOperator const*) CGExprAgg.cpp:0:0
#15 0x00000000041c5c4b (anonymous namespace)::AggExprEmitter::Visit(clang::Expr*) CGExprAgg.cpp:0:0
#16 0x00000000041c6260 clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr const*, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x41c6260)
#17 0x000000000418a231 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x418a231)
#18 0x00000000041b075d clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x41b075d)
#19 0x000000000431f53e clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x431f53e)
#20 0x00000000043276fc clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x43276fc)
#21 0x000000000438cd4c clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x438cd4c)
#22 0x000000000439fe4e clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x439fe4e)
#23 0x0000000004408d0a clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4408d0a)
#24 0x0000000004403f64 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4403f64)
#25 0x000000000441004d clang::CodeGen::CodeGenModule::EmitDeferred() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x441004d)
#26 0x0000000004412333 clang::CodeGen::CodeGenModule::Release() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4412333)
#27 0x00000000048097de (anonymous namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&) ModuleBuilder.cpp:0:0
#28 0x0000000004806145 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4806145)
#29 0x00000000063f982c clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x63f982c)
#30 0x00000000048068f8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x48068f8)
#31 0x0000000004ad0245 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4ad0245)
#32 0x0000000004a53a0e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4a53a0e)
#33 0x0000000004bbec9e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4bbec9e)
#34 0x0000000000d3a4ff cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xd3a4ff)
#35 0x0000000000d31f7a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#36 0x000000000484eb49 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
#37 0x0000000003d91374 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3d91374)
#38 0x000000000484f13f 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
#39 0x0000000004811a3d clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4811a3d)
#40 0x0000000004812abe 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+0x4812abe)
#41 0x000000000481aa55 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x481aa55)
#42 0x0000000000d372f3 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xd372f3)
#43 0x0000000000c08b94 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xc08b94)
#44 0x000079e1f4029d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#45 0x000079e1f4029e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#46 0x0000000000d31a25 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xd31a25)
clang: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```
Code:
```c
static void test_simple_assign(void) {
struct s {
short a[];
};
struct s init, copy;
_Atomic struct s s1, s2;
for (int j = 0; j < 1024; j++)
init.a[j] = j;
copy = (s1 = init);
}
int main(void) {
test_simple_assign();
}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs