<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/128532>128532</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Assertion `!rvalue.isAggregate() || rvalue.getAggregateAddress().getElementType() == dest.getAddress().getElementType()' failed
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          bi6c
      </td>
    </tr>
</table>

<pre>
    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();
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzkWl1z3CgW_TX4heouCfT54Ae5bWczlalJxd7MYxdCSE0igQqQY8-v3wLUrZbcTmJvz-xsTapTlhBczjlcuFcCojVvBGOXIL4C8fUFGcxOqsuSJ_SilNXT5UZ2PW-ZgjePfSsVUwAXcGdMrwEuALoF6LaRVSlbs5aqAej2D4Bud7-qP-rk_vcvICjsLwn8j0qhZctAUNCWiMaaAuhWSWkAum3bh27VK_mFUXvra6DblpcA3W5kxd4xYa_eFUZ2nK5p3wNchHmWWDsPkldwbxXgYt_g-OZ2ENRwORbedNx4U3dGKgZQ9lLzT59JOzCANi928OFQw7LwZd72b6piilsmG1hK2U5_cwu70JopiwlahVCoHqyhNddF0yjWEGNxAZRDkG5AuoHj84aZQ4WiqhTT2tezT25a1jFh7p_6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