llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.66k stars 11.85k forks source link

ppc64le backend error: failed to perform tail call elimination on a call site marked musttail #108014

Closed sharkcz closed 1 month ago

sharkcz commented 1 month ago

Compiling WebKitGtk, resp. the bundled Skia library, on Fedora Rawhide on ppc64le fails with a backend error.

/usr/bin/clang++ -DBUILDING_GTK__=1 -DBUILDING_WEBKIT=1 -DBUILDING_WITH_CMAKE=1 -DBWRAP_EXECUTABLE=\"/usr/bin/bwrap\" -DDBUS_PROXY_EXECUTABLE=\"/usr/bin/xdg-dbus-proxy\" -DGETTEXT_PACKAGE=\"
WebKitGTK-6.0\" -DHAVE_CONFIG_H=1 -DJSC_GLIB_API_ENABLED -DPAS_BMALLOC=1 -DSKCMS_DISABLE_HSW -DSKCMS_DISABLE_SKX -DSKIA_IMPLEMENTATION=1 -DSK_ASSUME_GL=0 -DSK_ASSUME_GL_ES=1 -DSK_ASSUME_WEBG
L=0 -DSK_CODEC_DECODES_PNG -DSK_DISABLE_LEGACY_GL_MAKE_NATIVE_INTERFACE -DSK_DISABLE_LEGACY_IMAGE_READBUFFER -DSK_DISABLE_LEGACY_INIT_DECODERS -DSK_DISABLE_LEGACY_PNG_WRITEBUFFER -DSK_DISABL
E_TRACING -DSK_DISABLE_WEBGL_INTERFACE -DSK_ENABLE_PRECOMPILE -DSK_GAMMA_APPLY_TO_A8 -DSK_GANESH -DSK_GL -DSK_R32_SHIFT=16 -DSK_RELEASE -DSK_TRIVIAL_ABI=[[clang::trivial_abi]] -DSK_TYPEFACE_
FACTORY_FREETYPE -I/builddir/build/BUILD/webkitgtk-2.45.92-build/webkitgtk-2.45.92/Source/ThirdParty/skia -isystem /usr/include/freetype2 -fdiagnostics-color=always -fcolor-diagnostics -Wext
ra -Wall -pipe -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-parentheses-equality -Qunused-arguments -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wc
ast-align -Wno-tautological-compare -O2  -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS --confi
g=/usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong   -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -fno-strict-aliasing -fno-exc
eptions -fno-rtti -fcoroutines -ffunction-sections -fdata-sections -DNDEBUG -std=c++23 -fPIC -fvisibility=hidden -ffp-contract=off -fstrict-aliasing -Wno-attributes -Wno-cast-align -Wno-depr
ecated -Wno-psabi -Wno-undef -Wno-uninitialized -Wno-unused-parameter -pthread -DWITH_GZFILEOP -MD -MT Source/ThirdParty/skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp.o -MF Source/ThirdParty/
skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp.o.d -o Source/ThirdParty/skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp.o -c /builddir/build/BUILD/webkitgtk-2.45.92-build/webkitgtk-2.45.92/Source
/ThirdParty/skia/src/core/SkOpts.cpp
fatal error: error in backend: failed to perform tail call elimination on a call site marked musttail
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: /usr/bin/clang++ -DBUILDING_GTK__=1 -DBUILDING_WEBKIT=1 -DBUILDING_WITH_CMAKE=1 -DBWRAP_EXECUTABLE=\"/usr/bin/bwrap\" -DDBUS_PROXY_EXECUTABLE=\"/usr/bin/xdg-dbus-p
roxy\" -DGETTEXT_PACKAGE=\"WebKitGTK-6.0\" -DHAVE_CONFIG_H=1 -DJSC_GLIB_API_ENABLED -DPAS_BMALLOC=1 -DSKCMS_DISABLE_HSW -DSKCMS_DISABLE_SKX -DSKIA_IMPLEMENTATION=1 -DSK_ASSUME_GL=0 -DSK_ASSU
ME_GL_ES=1 -DSK_ASSUME_WEBGL=0 -DSK_CODEC_DECODES_PNG -DSK_DISABLE_LEGACY_GL_MAKE_NATIVE_INTERFACE -DSK_DISABLE_LEGACY_IMAGE_READBUFFER -DSK_DISABLE_LEGACY_INIT_DECODERS -DSK_DISABLE_LEGACY_
PNG_WRITEBUFFER -DSK_DISABLE_TRACING -DSK_DISABLE_WEBGL_INTERFACE -DSK_ENABLE_PRECOMPILE -DSK_GAMMA_APPLY_TO_A8 -DSK_GANESH -DSK_GL -DSK_R32_SHIFT=16 -DSK_RELEASE -DSK_TRIVIAL_ABI=[[clang::t
rivial_abi]] -DSK_TYPEFACE_FACTORY_FREETYPE -I/builddir/build/BUILD/webkitgtk-2.45.92-build/webkitgtk-2.45.92/Source/ThirdParty/skia -isystem /usr/include/freetype2 -fdiagnostics-color=alway
s -fcolor-diagnostics -Wextra -Wall -pipe -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-parentheses-equality -Qunused-arguments -Wundef -Wpointer-arith -Wmissing-format-attr
ibute -Wformat-security -Wcast-align -Wno-tautological-compare -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_
GLIBCXX_ASSERTIONS --config=/usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -fno-
strict-aliasing -fno-exceptions -fno-rtti -fcoroutines -ffunction-sections -fdata-sections -DNDEBUG -std=c++23 -fPIC -fvisibility=hidden -ffp-contract=off -fstrict-aliasing -Wno-attributes -
Wno-cast-align -Wno-deprecated -Wno-psabi -Wno-undef -Wno-uninitialized -Wno-unused-parameter -pthread -DWITH_GZFILEOP -MD -MT Source/ThirdParty/skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp.
o -MF Source/ThirdParty/skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp.o.d -o Source/ThirdParty/skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp.o -c /builddir/build/BUILD/webkitgtk-2.45.92-build/
webkitgtk-2.45.92/Source/ThirdParty/skia/src/core/SkOpts.cpp
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module '/builddir/build/BUILD/webkitgtk-2.45.92-build/webkitgtk-2.45.92/Source/ThirdParty/skia/src/core/SkOpts.cpp'.
4.      Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@_ZN8portableL16set_base_pointerEPNS_6ParamsEP21SkRasterPipelineStageffff'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVM.so.18.1      0x00007fff9aab9924 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 132
1  libLLVM.so.18.1      0x00007fff9aaba188
2  libLLVM.so.18.1      0x00007fff9aab6970 llvm::sys::RunSignalHandlers() + 192
3  libLLVM.so.18.1      0x00007fff9aab88c0 llvm::sys::CleanupOnSignal(unsigned long) + 448
4  libLLVM.so.18.1      0x00007fff9a9abd10
5  libLLVM.so.18.1      0x00007fff9a9abc90 llvm::CrashRecoveryContext::HandleExit(int) + 32
6  libLLVM.so.18.1      0x00007fff9aab2030 llvm::sys::Process::Exit(int, bool) + 144
7  clang++              0x000000010f6cbaf0
8  libLLVM.so.18.1      0x00007fff9a9c393c llvm::report_fatal_error(llvm::Twine const&, bool) + 396
9  libLLVM.so.18.1      0x00007fff9a9c379c llvm::report_fatal_error(char const*, bool) + 76
10 libLLVM.so.18.1      0x00007fff9e1a0328
11 libLLVM.so.18.1      0x00007fff9b5557ac llvm::TargetLowering::LowerCallTo(llvm::TargetLowering::CallLoweringInfo&) const + 7660
12 libLLVM.so.18.1      0x00007fff9b571e7c llvm::SelectionDAGBuilder::lowerInvokable(llvm::TargetLowering::CallLoweringInfo&, llvm::BasicBlock const*) + 332
13 libLLVM.so.18.1      0x00007fff9b55d590 llvm::SelectionDAGBuilder::LowerCallTo(llvm::CallBase const&, llvm::SDValue, bool, bool, llvm::BasicBlock const*) + 4592
14 libLLVM.so.18.1      0x00007fff9b546df8 llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&) + 344
15 libLLVM.so.18.1      0x00007fff9b53abd0 llvm::SelectionDAGBuilder::visit(unsigned int, llvm::User const&) + 896
16 libLLVM.so.18.1      0x00007fff9b539748 llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 440
17 libLLVM.so.18.1      0x00007fff9b5fb094 llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void, true>, false, true>, llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void, true>, false, true>, bool&) + 468
18 libLLVM.so.18.1      0x00007fff9b5fa6ec llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 7180
19 libLLVM.so.18.1      0x00007fff9b5f7a5c llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 3036
20 libLLVM.so.18.1      0x00007fff9e165cec
21 libLLVM.so.18.1      0x00007fff9b02076c llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 1420
22 libLLVM.so.18.1      0x00007fff9acafce0 llvm::FPPassManager::runOnFunction(llvm::Function&) + 1184
23 libLLVM.so.18.1      0x00007fff9acb95a4 llvm::FPPassManager::runOnModule(llvm::Module&) + 84
24 libLLVM.so.18.1      0x00007fff9acb0774 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1492
25 libLLVM.so.18.1      0x00007fff9acb9adc llvm::legacy::PassManager::run(llvm::Module&) + 28
26 libclang-cpp.so.18.1 0x00007fffa3a0c034 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>>, clang::BackendConsumer*) + 11668
27 libclang-cpp.so.18.1 0x00007fffa3e577dc clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 1948
28 libclang-cpp.so.18.1 0x00007fffa21eff80 clang::ParseAST(clang::Sema&, bool, bool) + 864
29 libclang-cpp.so.18.1 0x00007fffa4d24f60 clang::ASTFrontendAction::ExecuteAction() + 272
30 libclang-cpp.so.18.1 0x00007fffa3e5d4a8 clang::CodeGenAction::ExecuteAction() + 296
31 libclang-cpp.so.18.1 0x00007fffa4d24528 clang::FrontendAction::Execute() + 152
32 libclang-cpp.so.18.1 0x00007fffa4c93e78 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1016
33 libclang-cpp.so.18.1 0x00007fffa4dc3538 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 664
34 clang++              0x000000010f6cb6c4 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 6436
35 clang++              0x000000010f6c7740
36 libclang-cpp.so.18.1 0x00007fffa482da28
37 libLLVM.so.18.1      0x00007fff9a9abc34 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 212
38 libclang-cpp.so.18.1 0x00007fffa482d148 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const + 376
39 libclang-cpp.so.18.1 0x00007fffa47eb1cc clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const + 1020
40 libclang-cpp.so.18.1 0x00007fffa47eb4c4 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const + 212
41 libclang-cpp.so.18.1 0x00007fffa480c6c0 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) + 704
42 clang++              0x000000010f6c6e88 clang_main(int, char**, llvm::ToolContext const&) + 12584
43 clang++              0x000000010f6d63dc main + 108
44 libc.so.6            0x00007fff99c1128c
45 libc.so.6            0x00007fff99c114cc __libc_start_main + 428
clang++: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 18.1.8 (Fedora 18.1.8-3.fc41)
Target: ppc64le-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Configuration file: /etc/clang/ppc64le-redhat-linux-gnu-clang++.cfg
Configuration file: /usr/lib/rpm/redhat/redhat-hardened-clang.cfg
clang++: note: diagnostic msg: 
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /tmp/SkOpts-e2b158.cpp
clang++: note: diagnostic msg: /tmp/SkOpts-e2b158.sh
clang++: note: diagnostic msg: 
********************

SkOpts-e2b158.cpp.gz SkOpts-e2b158.sh.gz

llvmbot commented 1 month ago

@llvm/issue-subscribers-backend-powerpc

Author: Dan Horák (sharkcz)

Compiling WebKitGtk, resp. the bundled Skia library, on Fedora Rawhide on ppc64le fails with a backend error. ```` /usr/bin/clang++ -DBUILDING_GTK__=1 -DBUILDING_WEBKIT=1 -DBUILDING_WITH_CMAKE=1 -DBWRAP_EXECUTABLE=\"/usr/bin/bwrap\" -DDBUS_PROXY_EXECUTABLE=\"/usr/bin/xdg-dbus-proxy\" -DGETTEXT_PACKAGE=\" WebKitGTK-6.0\" -DHAVE_CONFIG_H=1 -DJSC_GLIB_API_ENABLED -DPAS_BMALLOC=1 -DSKCMS_DISABLE_HSW -DSKCMS_DISABLE_SKX -DSKIA_IMPLEMENTATION=1 -DSK_ASSUME_GL=0 -DSK_ASSUME_GL_ES=1 -DSK_ASSUME_WEBG L=0 -DSK_CODEC_DECODES_PNG -DSK_DISABLE_LEGACY_GL_MAKE_NATIVE_INTERFACE -DSK_DISABLE_LEGACY_IMAGE_READBUFFER -DSK_DISABLE_LEGACY_INIT_DECODERS -DSK_DISABLE_LEGACY_PNG_WRITEBUFFER -DSK_DISABL E_TRACING -DSK_DISABLE_WEBGL_INTERFACE -DSK_ENABLE_PRECOMPILE -DSK_GAMMA_APPLY_TO_A8 -DSK_GANESH -DSK_GL -DSK_R32_SHIFT=16 -DSK_RELEASE -DSK_TRIVIAL_ABI=[[clang::trivial_abi]] -DSK_TYPEFACE_ FACTORY_FREETYPE -I/builddir/build/BUILD/webkitgtk-2.45.92-build/webkitgtk-2.45.92/Source/ThirdParty/skia -isystem /usr/include/freetype2 -fdiagnostics-color=always -fcolor-diagnostics -Wext ra -Wall -pipe -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-parentheses-equality -Qunused-arguments -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wc ast-align -Wno-tautological-compare -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS --confi g=/usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -fno-strict-aliasing -fno-exc eptions -fno-rtti -fcoroutines -ffunction-sections -fdata-sections -DNDEBUG -std=c++23 -fPIC -fvisibility=hidden -ffp-contract=off -fstrict-aliasing -Wno-attributes -Wno-cast-align -Wno-depr ecated -Wno-psabi -Wno-undef -Wno-uninitialized -Wno-unused-parameter -pthread -DWITH_GZFILEOP -MD -MT Source/ThirdParty/skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp.o -MF Source/ThirdParty/ skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp.o.d -o Source/ThirdParty/skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp.o -c /builddir/build/BUILD/webkitgtk-2.45.92-build/webkitgtk-2.45.92/Source /ThirdParty/skia/src/core/SkOpts.cpp fatal error: error in backend: failed to perform tail call elimination on a call site marked musttail 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: /usr/bin/clang++ -DBUILDING_GTK__=1 -DBUILDING_WEBKIT=1 -DBUILDING_WITH_CMAKE=1 -DBWRAP_EXECUTABLE=\"/usr/bin/bwrap\" -DDBUS_PROXY_EXECUTABLE=\"/usr/bin/xdg-dbus-p roxy\" -DGETTEXT_PACKAGE=\"WebKitGTK-6.0\" -DHAVE_CONFIG_H=1 -DJSC_GLIB_API_ENABLED -DPAS_BMALLOC=1 -DSKCMS_DISABLE_HSW -DSKCMS_DISABLE_SKX -DSKIA_IMPLEMENTATION=1 -DSK_ASSUME_GL=0 -DSK_ASSU ME_GL_ES=1 -DSK_ASSUME_WEBGL=0 -DSK_CODEC_DECODES_PNG -DSK_DISABLE_LEGACY_GL_MAKE_NATIVE_INTERFACE -DSK_DISABLE_LEGACY_IMAGE_READBUFFER -DSK_DISABLE_LEGACY_INIT_DECODERS -DSK_DISABLE_LEGACY_ PNG_WRITEBUFFER -DSK_DISABLE_TRACING -DSK_DISABLE_WEBGL_INTERFACE -DSK_ENABLE_PRECOMPILE -DSK_GAMMA_APPLY_TO_A8 -DSK_GANESH -DSK_GL -DSK_R32_SHIFT=16 -DSK_RELEASE -DSK_TRIVIAL_ABI=[[clang::t rivial_abi]] -DSK_TYPEFACE_FACTORY_FREETYPE -I/builddir/build/BUILD/webkitgtk-2.45.92-build/webkitgtk-2.45.92/Source/ThirdParty/skia -isystem /usr/include/freetype2 -fdiagnostics-color=alway s -fcolor-diagnostics -Wextra -Wall -pipe -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-parentheses-equality -Qunused-arguments -Wundef -Wpointer-arith -Wmissing-format-attr ibute -Wformat-security -Wcast-align -Wno-tautological-compare -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_ GLIBCXX_ASSERTIONS --config=/usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -fno- strict-aliasing -fno-exceptions -fno-rtti -fcoroutines -ffunction-sections -fdata-sections -DNDEBUG -std=c++23 -fPIC -fvisibility=hidden -ffp-contract=off -fstrict-aliasing -Wno-attributes - Wno-cast-align -Wno-deprecated -Wno-psabi -Wno-undef -Wno-uninitialized -Wno-unused-parameter -pthread -DWITH_GZFILEOP -MD -MT Source/ThirdParty/skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp. o -MF Source/ThirdParty/skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp.o.d -o Source/ThirdParty/skia/CMakeFiles/Skia.dir/src/core/SkOpts.cpp.o -c /builddir/build/BUILD/webkitgtk-2.45.92-build/ webkitgtk-2.45.92/Source/ThirdParty/skia/src/core/SkOpts.cpp 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module '/builddir/build/BUILD/webkitgtk-2.45.92-build/webkitgtk-2.45.92/Source/ThirdParty/skia/src/core/SkOpts.cpp'. 4. Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@_ZN8portableL16set_base_pointerEPNS_6ParamsEP21SkRasterPipelineStageffff' Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it): 0 libLLVM.so.18.1 0x00007fff9aab9924 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 132 1 libLLVM.so.18.1 0x00007fff9aaba188 2 libLLVM.so.18.1 0x00007fff9aab6970 llvm::sys::RunSignalHandlers() + 192 3 libLLVM.so.18.1 0x00007fff9aab88c0 llvm::sys::CleanupOnSignal(unsigned long) + 448 4 libLLVM.so.18.1 0x00007fff9a9abd10 5 libLLVM.so.18.1 0x00007fff9a9abc90 llvm::CrashRecoveryContext::HandleExit(int) + 32 6 libLLVM.so.18.1 0x00007fff9aab2030 llvm::sys::Process::Exit(int, bool) + 144 7 clang++ 0x000000010f6cbaf0 8 libLLVM.so.18.1 0x00007fff9a9c393c llvm::report_fatal_error(llvm::Twine const&, bool) + 396 9 libLLVM.so.18.1 0x00007fff9a9c379c llvm::report_fatal_error(char const*, bool) + 76 10 libLLVM.so.18.1 0x00007fff9e1a0328 11 libLLVM.so.18.1 0x00007fff9b5557ac llvm::TargetLowering::LowerCallTo(llvm::TargetLowering::CallLoweringInfo&) const + 7660 12 libLLVM.so.18.1 0x00007fff9b571e7c llvm::SelectionDAGBuilder::lowerInvokable(llvm::TargetLowering::CallLoweringInfo&, llvm::BasicBlock const*) + 332 13 libLLVM.so.18.1 0x00007fff9b55d590 llvm::SelectionDAGBuilder::LowerCallTo(llvm::CallBase const&, llvm::SDValue, bool, bool, llvm::BasicBlock const*) + 4592 14 libLLVM.so.18.1 0x00007fff9b546df8 llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&) + 344 15 libLLVM.so.18.1 0x00007fff9b53abd0 llvm::SelectionDAGBuilder::visit(unsigned int, llvm::User const&) + 896 16 libLLVM.so.18.1 0x00007fff9b539748 llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 440 17 libLLVM.so.18.1 0x00007fff9b5fb094 llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void, true>, false, true>, llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void, true>, false, true>, bool&) + 468 18 libLLVM.so.18.1 0x00007fff9b5fa6ec llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 7180 19 libLLVM.so.18.1 0x00007fff9b5f7a5c llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 3036 20 libLLVM.so.18.1 0x00007fff9e165cec 21 libLLVM.so.18.1 0x00007fff9b02076c llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 1420 22 libLLVM.so.18.1 0x00007fff9acafce0 llvm::FPPassManager::runOnFunction(llvm::Function&) + 1184 23 libLLVM.so.18.1 0x00007fff9acb95a4 llvm::FPPassManager::runOnModule(llvm::Module&) + 84 24 libLLVM.so.18.1 0x00007fff9acb0774 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1492 25 libLLVM.so.18.1 0x00007fff9acb9adc llvm::legacy::PassManager::run(llvm::Module&) + 28 26 libclang-cpp.so.18.1 0x00007fffa3a0c034 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>>, clang::BackendConsumer*) + 11668 27 libclang-cpp.so.18.1 0x00007fffa3e577dc clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 1948 28 libclang-cpp.so.18.1 0x00007fffa21eff80 clang::ParseAST(clang::Sema&, bool, bool) + 864 29 libclang-cpp.so.18.1 0x00007fffa4d24f60 clang::ASTFrontendAction::ExecuteAction() + 272 30 libclang-cpp.so.18.1 0x00007fffa3e5d4a8 clang::CodeGenAction::ExecuteAction() + 296 31 libclang-cpp.so.18.1 0x00007fffa4d24528 clang::FrontendAction::Execute() + 152 32 libclang-cpp.so.18.1 0x00007fffa4c93e78 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1016 33 libclang-cpp.so.18.1 0x00007fffa4dc3538 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 664 34 clang++ 0x000000010f6cb6c4 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 6436 35 clang++ 0x000000010f6c7740 36 libclang-cpp.so.18.1 0x00007fffa482da28 37 libLLVM.so.18.1 0x00007fff9a9abc34 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 212 38 libclang-cpp.so.18.1 0x00007fffa482d148 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const + 376 39 libclang-cpp.so.18.1 0x00007fffa47eb1cc clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const + 1020 40 libclang-cpp.so.18.1 0x00007fffa47eb4c4 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const + 212 41 libclang-cpp.so.18.1 0x00007fffa480c6c0 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) + 704 42 clang++ 0x000000010f6c6e88 clang_main(int, char**, llvm::ToolContext const&) + 12584 43 clang++ 0x000000010f6d63dc main + 108 44 libc.so.6 0x00007fff99c1128c 45 libc.so.6 0x00007fff99c114cc __libc_start_main + 428 clang++: error: clang frontend command failed with exit code 70 (use -v to see invocation) clang version 18.1.8 (Fedora 18.1.8-3.fc41) Target: ppc64le-redhat-linux-gnu Thread model: posix InstalledDir: /usr/bin Configuration file: /etc/clang/ppc64le-redhat-linux-gnu-clang++.cfg Configuration file: /usr/lib/rpm/redhat/redhat-hardened-clang.cfg clang++: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang++: note: diagnostic msg: /tmp/SkOpts-e2b158.cpp clang++: note: diagnostic msg: /tmp/SkOpts-e2b158.sh clang++: note: diagnostic msg: ******************** ```` [SkOpts-e2b158.cpp.gz](https://github.com/user-attachments/files/16944658/SkOpts-e2b158.cpp.gz) [SkOpts-e2b158.sh.gz](https://github.com/user-attachments/files/16944659/SkOpts-e2b158.sh.gz)
tstellar commented 1 month ago

Reduced Test Case:

target datalayout = "e-m:e-Fn32-i64:64-n32:64-S128-v256:256:256-v512:512:512"
target triple = "ppc64le-redhat-linux-gnu"

define void @_ZN8portableL16set_base_pointerEPNS_6ParamsEP21SkRasterPipelineStageffff(ptr %0, ptr %1, float %2, float %3, float %4, float %5) {
  musttail call void null(ptr null, ptr null, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
  ret void
}
efriedma-quic commented 1 month ago

The error message should be fixed by https://github.com/llvm/llvm-project/pull/93267 (which was merged into LLVM 19). https://github.com/llvm/llvm-project/issues/98859 tracks actually adding complete musttail support.

stefanp-ibm commented 1 month ago

I tired this with the most recent Top of Trunk on main branch and I have this error instead:

/builddir/build/BUILD/webkitgtk-2.45.92-build/webkitgtk-2.45.92/Source/ThirdParty/skia/src/opts/SkRasterPipeline_opts.h:3852:471: error: 'musttail' attribute for this call is impossible because indirect calls can not be tail called on PPC
 3852 | __attribute__((always_inline)) static inline void set_base_pointer_k(std::byte* p, size_t dx, size_t dy, std::byte*& base, F& r, F& g, F& b, F& a, F& dr, F& dg, F& db, F& da); static void set_base_pointer(Params* params, SkRasterPipelineStage* program, F r, F g, F b, F a) { set_base_pointer_k(Ctx{program}, params->dx,params->dy,params->base, r,g,b,a, params->dr, params->dg, params->db, params->da); ++program; auto fn = (Stage)program->fn; [[clang::musttail]] return fn(params, program, r,g,b,a); } __attribute__((always_inline)) static inline void set_base_pointer_k(std::byte* p, size_t dx, size_t dy, std::byte*& base, F& r, F& g, F& b, F& a, F& dr, F& dg, F& db, F& da) {

As mentioned above this is currently a limitation on PowerPC.

tstellar commented 1 month ago

@efriedma-quic So the correct fix then is to fix the application to not add the MustTail attribute on PowerPC ?

tstellar commented 1 month ago

Also is it possible to have __has_cpp_attribute(clang::musttail) return false only on PowerPC ?

mcatanzaro commented 1 month ago

Also is it possible to have __has_cpp_attribute(clang::musttail) return false only on PowerPC ?

This would certainly make it easier to write portable software.

chenzheng1030 commented 1 month ago

Also is it possible to have __has_cpp_attribute(clang::musttail) return false only on PowerPC ?

This would certainly make it easier to write portable software.

To be clear, PPC does support tail call, but it can not do tail call for some kind of calls like indirect calls.

mcatanzaro commented 1 month ago

WebKit pull request