<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/68390>68390</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
powerpc64le-linux-gnu 128-bit atomic max causes ICE
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
programmerjake
</td>
</tr>
</table>
<pre>
https://clang.godbolt.org/z/jn6G5z1aP
```c++
__int128 f(__int128 *p, __int128 v) {
return __atomic_fetch_max(p, v, 0);
}
```
```
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-17.0.1/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-13.2.0 -fcolor-diagnostics -fno-crash-diagnostics --target=powerpc64le-linux-gnu -O3 -mcpu=pwr8 <source>
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module '<source>'.
4. Running pass 'Expand Atomic instructions' on function '@_Z1fPnn'
#0 0x0000000003349f18 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x3349f18)
#1 0x0000000003348044 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x3348044)
#2 0x000000000329c028 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007f9c1ff92420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x0000000002c98293 llvm::Intrinsic::getIntrinsicInfoTableEntries(unsigned int, llvm::SmallVectorImpl<llvm::Intrinsic::IITDescriptor>&) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x2c98293)
#5 0x0000000002c9841c llvm::Intrinsic::getType(llvm::LLVMContext&, unsigned int, llvm::ArrayRef<llvm::Type*>) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x2c9841c)
#6 0x0000000002ca3292 llvm::Intrinsic::getDeclaration(llvm::Module*, unsigned int, llvm::ArrayRef<llvm::Type*>) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x2ca3292)
#7 0x0000000001b7b6b3 llvm::PPCTargetLowering::emitMaskedAtomicRMWIntrinsic(llvm::IRBuilderBase&, llvm::AtomicRMWInst*, llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, llvm::AtomicOrdering) const (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x1b7b6b3)
#8 0x0000000002688393 (anonymous namespace)::AtomicExpand::tryExpandAtomicRMW(llvm::AtomicRMWInst*) AtomicExpandPass.cpp:0:0
#9 0x0000000002689b69 (anonymous namespace)::AtomicExpand::runOnFunction(llvm::Function&) AtomicExpandPass.cpp:0:0
#10 0x0000000002cfad02 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x2cfad02)
#11 0x0000000002cfae81 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x2cfae81)
#12 0x0000000002cfc9f0 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x2cfc9f0)
#13 0x00000000035b10d0 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x35b10d0)
#14 0x00000000044f947c clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x44f947c)
#15 0x00000000058beb69 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x58beb69)
#16 0x00000000044f8b05 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x44f8b05)
#17 0x0000000003dd5f21 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x3dd5f21)
#18 0x0000000003d5b9fb clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x3d5b9fb)
#19 0x0000000003eb5c23 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x3eb5c23)
#20 0x0000000000bd50c5 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0xbd50c5)
#21 0x0000000000bce42d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#22 0x0000000003ba7489 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
#23 0x000000000329c453 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x329c453)
#24 0x0000000003ba76a9 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
#25 0x0000000003b6f477 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x3b6f477)
#26 0x0000000003b6fe2d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x3b6fe2d)
#27 0x0000000003b79d0c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0x3b79d0c)
#28 0x0000000000bd2d31 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0xbd2d31)
#29 0x0000000000acf511 main (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0xacf511)
#30 0x00007f9c1fa36083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#31 0x0000000000bcdc2e _start (/opt/compiler-explorer/clang-17.0.1/bin/clang+++0xbcdc2e)
clang++: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Compiler returned: 139
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWV1vqzga_jX0xiICQwhc9CJNm5mOetSq7c5Ke4OMeSGegs3apk3n16-MSYLTtHPObs5qpT3qSYI_n_d5P7GJUqzmAJfe_MqbX1-QXm-EvOykqCVpW5B_kBe4KET5frnRulNetPTw2sNr2hBez2pRFqLRMyFrD6__9PD6D578Mv8zJA9ecO0Fy_EzCewf9fCV-Rta85xxHeIUVR5O9w8eXnYeXqF9w6uHM-QtxkkIISRB95KjPCdatIzmFWi6yVuy9XA6zH01H4GHMy8ap3mL6yMoJ_HZx4e7m-XTDVJ90TKNCCr6GknohNRIC-TyUDO96YsZFa2H103zuvvyOyn-AKo9vGZK9aA8vEaEl4hx2vQlIL0BRCVRG1QQ-qIloWBQdxI6KSgoBSVSope22cwkSgnKiIYSyZ4jRSXr9MxCftKEvqCybzuDbGgKZl6QPVhFIiLrvgWuDXDk4bXoDDIq2o41IH3Ydo2QIHeK9cPFLJiFHl4XjO8are6QX5dvRFZ-jPwa-cKsRrr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