<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/115652>115652</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang][OpenMP] llvm-project/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:8095: OpenMPIRBuilder::InsertPointTy llvm::OpenMPIRBuilder::createAtomicWrite(const llvm::OpenMPIRBuilder::LocationDescription &, llvm::OpenMPIRBuilder::AtomicOpValue &, llvm::Value *, llvm::AtomicOrdering): Assertion `(XElemTy->isFloatingPointTy() || XElemTy->isIntegerTy() || XElemTy->isPointerTy()) && "OMP atomic write expected a scalar type"' failed.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
k-arrows
</td>
</tr>
</table>
<pre>
Reproducer:
```f90
real :: r1
complex :: c1
!$omp atomic write
c1 = r1
end
```
Stack dump:
```console
#0 0x00007f6aacc5f727 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
#1 0x00007f6aacc5d2be llvm::sys::RunSignalHandlers()
#2 0x00007f6aacc5fdfa SignalHandler(int) Signals.cpp:0:0
#3 0x00007f6aac597520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007f6aac5eb9fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#5 0x00007f6aac5eb9fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#6 0x00007f6aac5eb9fc pthread_kill ./nptl/pthread_kill.c:89:10
#7 0x00007f6aac597476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#8 0x00007f6aac57d7f3 abort ./stdlib/abort.c:81:7
#9 0x00007f6aac57d71b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x00007f6aac58ee96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#11 0x00007f6aa0b1259b llvm::OpenMPIRBuilder::createAtomicWrite(llvm::OpenMPIRBuilder::LocationDescription const&, llvm::OpenMPIRBuilder::AtomicOpValue&, llvm::Value*, llvm::AtomicOrdering)
#12 0x00007f6aa002f7f8 convertHostOrTargetOperation(mlir::Operation*, llvm::IRBuilderBase&, mlir::LLVM::ModuleTranslation&) OpenMPToLLVMIRTranslation.cpp:0:0
#13 0x00007f6aa2a44b1c mlir::LLVM::ModuleTranslation::convertOperation(mlir::Operation&, llvm::IRBuilderBase&, bool)
#14 0x00007f6aa2a4515a mlir::LLVM::ModuleTranslation::convertBlockImpl(mlir::Block&, bool, llvm::IRBuilderBase&, bool)
#15 0x00007f6aa2a49037 mlir::LLVM::ModuleTranslation::convertOneFunction(mlir::LLVM::LLVMFuncOp)
#16 0x00007f6aa2a4beed mlir::LLVM::ModuleTranslation::convertFunctions()
#17 0x00007f6aa2a4e83c mlir::translateModuleToLLVMIR(mlir::Operation*, llvm::LLVMContext&, llvm::StringRef, bool)
#18 0x00007f6aad92632a Fortran::frontend::CodeGenAction::generateLLVMIR()
#19 0x00007f6aad92a2e8 Fortran::frontend::CodeGenAction::executeAction()
#20 0x00007f6aad91f0fc Fortran::frontend::FrontendAction::execute()
#21 0x00007f6aad9052a2 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&)
#22 0x00007f6aada8f37c Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*)
#23 0x000055dc62ae335b fc1_main(llvm::ArrayRef<char const*>, char const*)
#24 0x000055dc62ae194a main
#25 0x00007f6aac57ed90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#26 0x00007f6aac57ee40 call_init ./csu/../csu/libc-start.c:128:20
#27 0x00007f6aac57ee40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#28 0x000055dc62ae1465 _start
flang-20: error: unable to execute command: Aborted (core dumped)
flang-20: error: flang frontend command failed due to signal (use -v to see invocation)
flang version 20.0.0git (https://github.com/llvm/llvm-project.git 0ac4821b718dd14e80d3856efa532d52df6878bb)
Target: x86_64-unknown-linux-gnu
Thread model: posix
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycWE1v27zS_TX0hohBUd8LL5ykfp8ALVKkwfPenUGRI0c3FCmQVOr8-wtSsmXZRtIGaBN5zDnnzGg4HIZZ2-wUwAqltyi9X7DevWizer1hxujfdlFp8b56gs5o0XMwKF4jco_IGmVk-FeXZLAYYBL77-M1NtFg47rtJOwPZj6aEY0QTXTbYeZ023D82zQORpcIo_j-iABKnBGOH8PPX47xVyz6trsUxrWyWo6oGNGYYLInhJC8zhjjPK1zmmMp39pBnX23w8NP0ygXkJ8N44BoMS0y7PdWW2eAtYhmiN7hRjlESzzRRGc0glZwjeapV7-anWLyH6aEBGMRLeZI9FywqBme-SBajPyD2S5551NBwv8jUDwDSss8pQQHuo1sKkQ3-yLbZsmNbFS_v9mpfviCL61eZojekn1CU0oQLSfMZI4JVVlzvN127sUAE9vXRspt499-C8ox12iFl4huVOckopvTZUuO4nWSoHidZxN--if4yoFRTH6InBcoXkcn2ciuIZ-6fQhXlGdw-XlykzzDOxveR0AaHhHdLMOndyugsx5a22aP6MawxkLApjmK1yc5KObQucjrGLNKGzcAOzG8vmAa1EU-4gmhvECIKrxVcis1E1uhW9YM76VRIVxvbu2OswEuinIvqTxs2ziab6K0ACizvyuluIQyO5aSx5ztGFJFNC2rkx3z2IH68fPh6bZvpBhaULzmBpiDdWgf_x-6x-k2veryXfNQh_dguWm6UJK-SbhxJ3_iPnA9dv8y2cOFy2hdz62jjxFgGrWbdrePera7CaF1XhdezxsY94-27tE8M7MD99iBCboRLVrZmKPEg_WM8yj7ltmDzsnv-_d_fwxPP7ToJTwbpqwckfxrwUPwz9qvfHg6-f6yt_gwZr2FsiSpIv6HfMOLHCL-NMrs8ygrreU8x8mZuDRK2RfE3UrNXx_aTs7EBeuM-u8FpmcCSxLnX8megk2v-EX-Jn__5Jc8dnMB2ZmACkB8QcCBfX6IeYL8jACK-LQ-3AgII_5Ydn9Y637xn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