llvm / llvm-project

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

Fatal error: error in backend: Cannot select: 0x6008887851f0: i64 = bitcast Constant:i8<97> #80909

Open elsid opened 9 months ago

elsid commented 9 months ago

Compiler output:

fatal error: error in backend: Cannot select: 0x6008887851f0: i64 = bitcast Constant:i8<97>
  0x600887b2f890: i8 = Constant<97>
In function: _ZN3VFS4Path12_GLOBAL__N_136gtest_suite_NormalizedOperatorsTest_13supportsEqualINS0_14NormalizedViewEE8TestBodyEv
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++ -march=native -Wall -Wextra -Wundef -Wextra-semi -Wno-unused-parameter -pedantic -Wno-long-long -Wnon-virtual-dtor -Wunused -Wno-potentially-evaluated-expression -Og -std=c++20 -DBOOST_NO_CXX11_SCOPED_ENUMS=ON -DBT_USE_DOUBLE_PRECISION -DMYGUI_DONT_REPLACE_NULLPTR -DOPENMW_DATA_DIR=u8\"/home/elsid/dev/openmw/build/clang/fast/apps/openmw_test_suite/data\" -DOPENMW_PROJECT_SOURCE_DIR=u8\"/home/elsid/dev/openmw\" -D__STDC_CONSTANT_MACROS -I/home/elsid/dev/openmw/extern/Base64/. -I/home/elsid/dev/openmw/extern/smhasher/. -isystem /home/elsid/dev/icu/build/clang/release/install/include -isystem /home/elsid/dev/openmw/extern/sol_config -isystem /home/elsid/dev/openmw/extern/sol3 -isystem /home/elsid/dev/LuaJIT/build/clang/release/install/include/luajit-2.1 -isystem /home/elsid/dev/bullet3/build/clang/release/install/include/bullet -isystem /usr/include/AL -isystem /home/elsid/dev/mygui/build/clang/release/install/include/MYGUI -isystem /home/elsid/dev/boost/build/clang/release/boost_1_83_0/install/include -isystem /home/elsid/dev/openmw/. -isystem /home/elsid/dev/OpenSceneGraph/build/clang/release/install/include -isystem /home/elsid/dev/googletest/build/clang/release/install/include -isystem /usr/include/SDL2 -isystem /home/elsid/dev/recastnavigation/build/clang/release/install/include/recastnavigation -isystem /home/elsid/dev/yaml-cpp/build/clang/release/install/include -stdlib=libc++ -DNDEBUG -c -MD -MT apps/openmw_test_suite/CMakeFiles/openmw_test_suite.dir/vfs/testpathutil.cpp.o -MF CMakeFiles/openmw_test_suite.dir/vfs/testpathutil.cpp.o.d -fcolor-diagnostics -o CMakeFiles/openmw_test_suite.dir/vfs/testpathutil.cpp.o /home/elsid/dev/openmw/apps/openmw_test_suite/vfs/testpathutil.cpp
1.  <eof> parser at end of file
2.  Code generation
3.  Running pass 'Function Pass Manager' on module '/home/elsid/dev/openmw/apps/openmw_test_suite/vfs/testpathutil.cpp'.
4.  Running pass 'X86 DAG->DAG Instruction Selection' on function '@_ZN3VFS4Path12_GLOBAL__N_136gtest_suite_NormalizedOperatorsTest_13supportsEqualINS0_14NormalizedViewEE8TestBodyEv'
 #0 0x00007ef94bc1f503 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/libLLVM-16.so+0xe1f503)
 #1 0x00007ef94bc1c7bf llvm::sys::RunSignalHandlers() (/usr/lib/libLLVM-16.so+0xe1c7bf)
 #2 0x00007ef94bb08d9a llvm::CrashRecoveryContext::HandleExit(int) (/usr/lib/libLLVM-16.so+0xd08d9a)
 #3 0x00007ef94bc158d4 llvm::sys::Process::Exit(int, bool) (/usr/lib/libLLVM-16.so+0xe158d4)
 #4 0x00006008867ac463 (/usr/bin/clang+++0xf463)
 #5 0x00007ef94bb1f002 llvm::report_fatal_error(llvm::Twine const&, bool) (/usr/lib/libLLVM-16.so+0xd1f002)
 #6 0x00007ef94c6fad4a llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/usr/lib/libLLVM-16.so+0x18fad4a)
 #7 0x00007ef94c6fd7ba llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/usr/lib/libLLVM-16.so+0x18fd7ba)
 #8 0x00007ef94f7885f8 (/usr/lib/libLLVM-16.so+0x49885f8)
 #9 0x00007ef94c6f7f5c llvm::SelectionDAGISel::DoInstructionSelection() (/usr/lib/libLLVM-16.so+0x18f7f5c)
#10 0x00007ef94c70268c llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/usr/lib/libLLVM-16.so+0x190268c)
#11 0x00007ef94c70592d llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/usr/lib/libLLVM-16.so+0x190592d)
#12 0x00007ef94c7079b6 (/usr/lib/libLLVM-16.so+0x19079b6)
#13 0x00007ef94f78efb7 (/usr/lib/libLLVM-16.so+0x498efb7)
#14 0x00007ef94c0ea945 (/usr/lib/libLLVM-16.so+0x12ea945)
#15 0x00007ef94bdab989 llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/lib/libLLVM-16.so+0xfab989)
#16 0x00007ef94bdabd34 llvm::FPPassManager::runOnModule(llvm::Module&) (/usr/lib/libLLVM-16.so+0xfabd34)
#17 0x00007ef94bdac6ac llvm::legacy::PassManagerImpl::run(llvm::Module&) (/usr/lib/libLLVM-16.so+0xfac6ac)
#18 0x00007ef9548f3fb3 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/usr/lib/libclang-cpp.so.16+0x16f3fb3)
#19 0x00007ef954c19229 (/usr/lib/libclang-cpp.so.16+0x1a19229)
#20 0x00007ef953aecfb0 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/libclang-cpp.so.16+0x8ecfb0)
#21 0x00007ef95531e7c9 clang::FrontendAction::Execute() (/usr/lib/libclang-cpp.so.16+0x211e7c9)
#22 0x00007ef9552c0d2f clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/libclang-cpp.so.16+0x20c0d2f)
#23 0x00007ef95537bf02 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/libclang-cpp.so.16+0x217bf02)
#24 0x00006008867b1a6f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang+++0x14a6f)
#25 0x00006008867b5b10 (/usr/bin/clang+++0x18b10)
#26 0x00007ef954fec779 (/usr/lib/libclang-cpp.so.16+0x1dec779)
#27 0x00007ef94bb08c87 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/lib/libLLVM-16.so+0xd08c87)
#28 0x00007ef954ff30c4 (/usr/lib/libclang-cpp.so.16+0x1df30c4)
#29 0x00007ef955011431 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/usr/lib/libclang-cpp.so.16+0x1e11431)
#30 0x00007ef9550117ed clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/usr/lib/libclang-cpp.so.16+0x1e117ed)
#31 0x00007ef9550155dc clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/usr/lib/libclang-cpp.so.16+0x1e155dc)
#32 0x00006008867b899f clang_main(int, char**) (/usr/bin/clang+++0x1b99f)
#33 0x00007ef94a845cd0 (/usr/lib/libc.so.6+0x27cd0)
#34 0x00007ef94a845d8a __libc_start_main (/usr/lib/libc.so.6+0x27d8a)
#35 0x00006008867a9ed5 _start (/usr/bin/clang+++0xced5)
clang-16: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 16.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-16: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-16: note: diagnostic msg: /tmp/testpathutil-d50ae4.cpp
clang-16: note: diagnostic msg: /tmp/testpathutil-d50ae4.sh
clang-16: note: diagnostic msg:

Mentioned files: testpathutil-d50ae4.zip

Not preprocessed code (https://github.com/google/googletest/releases/tag/release-1.12.1 is used):

#include <gtest/gtest.h>

#include <stdexcept>
#include <string_view>

namespace VFS::Path
{
    struct NormalizedView
    {
        template <std::size_t size>
        constexpr NormalizedView(const char (&value)[size])
        {
            throw std::invalid_argument(value);
        }
    };

    namespace
    {
        using namespace testing;

        template <class T>
        struct NormalizedOperatorsTest : Test
        {
        };

        TYPED_TEST_SUITE_P(NormalizedOperatorsTest);

        TYPED_TEST_P(NormalizedOperatorsTest, supportsEqual)
        {
            const TypeParam otherEqual{ "a/foo/bar/baz" };
        }

        REGISTER_TYPED_TEST_SUITE_P(NormalizedOperatorsTest, supportsEqual);

        using NormalizedOperatorsParams = Types<const char[14], NormalizedView>;

        INSTANTIATE_TYPED_TEST_SUITE_P(StringTypes, NormalizedOperatorsTest, NormalizedOperatorsParams);
    }
}

The same code on the compiler explorer causing the error for comparison with other compilers: https://godbolt.org/z/Kd81djbds

llvmbot commented 9 months ago

@llvm/issue-subscribers-backend-x86

Author: Roman Siromakha (elsid)

Compiler output: ``` fatal error: error in backend: Cannot select: 0x6008887851f0: i64 = bitcast Constant:i8<97> 0x600887b2f890: i8 = Constant<97> In function: _ZN3VFS4Path12_GLOBAL__N_136gtest_suite_NormalizedOperatorsTest_13supportsEqualINS0_14NormalizedViewEE8TestBodyEv 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++ -march=native -Wall -Wextra -Wundef -Wextra-semi -Wno-unused-parameter -pedantic -Wno-long-long -Wnon-virtual-dtor -Wunused -Wno-potentially-evaluated-expression -Og -std=c++20 -DBOOST_NO_CXX11_SCOPED_ENUMS=ON -DBT_USE_DOUBLE_PRECISION -DMYGUI_DONT_REPLACE_NULLPTR -DOPENMW_DATA_DIR=u8\"/home/elsid/dev/openmw/build/clang/fast/apps/openmw_test_suite/data\" -DOPENMW_PROJECT_SOURCE_DIR=u8\"/home/elsid/dev/openmw\" -D__STDC_CONSTANT_MACROS -I/home/elsid/dev/openmw/extern/Base64/. -I/home/elsid/dev/openmw/extern/smhasher/. -isystem /home/elsid/dev/icu/build/clang/release/install/include -isystem /home/elsid/dev/openmw/extern/sol_config -isystem /home/elsid/dev/openmw/extern/sol3 -isystem /home/elsid/dev/LuaJIT/build/clang/release/install/include/luajit-2.1 -isystem /home/elsid/dev/bullet3/build/clang/release/install/include/bullet -isystem /usr/include/AL -isystem /home/elsid/dev/mygui/build/clang/release/install/include/MYGUI -isystem /home/elsid/dev/boost/build/clang/release/boost_1_83_0/install/include -isystem /home/elsid/dev/openmw/. -isystem /home/elsid/dev/OpenSceneGraph/build/clang/release/install/include -isystem /home/elsid/dev/googletest/build/clang/release/install/include -isystem /usr/include/SDL2 -isystem /home/elsid/dev/recastnavigation/build/clang/release/install/include/recastnavigation -isystem /home/elsid/dev/yaml-cpp/build/clang/release/install/include -stdlib=libc++ -DNDEBUG -c -MD -MT apps/openmw_test_suite/CMakeFiles/openmw_test_suite.dir/vfs/testpathutil.cpp.o -MF CMakeFiles/openmw_test_suite.dir/vfs/testpathutil.cpp.o.d -fcolor-diagnostics -o CMakeFiles/openmw_test_suite.dir/vfs/testpathutil.cpp.o /home/elsid/dev/openmw/apps/openmw_test_suite/vfs/testpathutil.cpp 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module '/home/elsid/dev/openmw/apps/openmw_test_suite/vfs/testpathutil.cpp'. 4. Running pass 'X86 DAG->DAG Instruction Selection' on function '@_ZN3VFS4Path12_GLOBAL__N_136gtest_suite_NormalizedOperatorsTest_13supportsEqualINS0_14NormalizedViewEE8TestBodyEv' #0 0x00007ef94bc1f503 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/libLLVM-16.so+0xe1f503) #1 0x00007ef94bc1c7bf llvm::sys::RunSignalHandlers() (/usr/lib/libLLVM-16.so+0xe1c7bf) #2 0x00007ef94bb08d9a llvm::CrashRecoveryContext::HandleExit(int) (/usr/lib/libLLVM-16.so+0xd08d9a) #3 0x00007ef94bc158d4 llvm::sys::Process::Exit(int, bool) (/usr/lib/libLLVM-16.so+0xe158d4) #4 0x00006008867ac463 (/usr/bin/clang+++0xf463) #5 0x00007ef94bb1f002 llvm::report_fatal_error(llvm::Twine const&, bool) (/usr/lib/libLLVM-16.so+0xd1f002) #6 0x00007ef94c6fad4a llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/usr/lib/libLLVM-16.so+0x18fad4a) #7 0x00007ef94c6fd7ba llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/usr/lib/libLLVM-16.so+0x18fd7ba) #8 0x00007ef94f7885f8 (/usr/lib/libLLVM-16.so+0x49885f8) #9 0x00007ef94c6f7f5c llvm::SelectionDAGISel::DoInstructionSelection() (/usr/lib/libLLVM-16.so+0x18f7f5c) #10 0x00007ef94c70268c llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/usr/lib/libLLVM-16.so+0x190268c) #11 0x00007ef94c70592d llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/usr/lib/libLLVM-16.so+0x190592d) #12 0x00007ef94c7079b6 (/usr/lib/libLLVM-16.so+0x19079b6) #13 0x00007ef94f78efb7 (/usr/lib/libLLVM-16.so+0x498efb7) #14 0x00007ef94c0ea945 (/usr/lib/libLLVM-16.so+0x12ea945) #15 0x00007ef94bdab989 llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/lib/libLLVM-16.so+0xfab989) #16 0x00007ef94bdabd34 llvm::FPPassManager::runOnModule(llvm::Module&) (/usr/lib/libLLVM-16.so+0xfabd34) #17 0x00007ef94bdac6ac llvm::legacy::PassManagerImpl::run(llvm::Module&) (/usr/lib/libLLVM-16.so+0xfac6ac) #18 0x00007ef9548f3fb3 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/usr/lib/libclang-cpp.so.16+0x16f3fb3) #19 0x00007ef954c19229 (/usr/lib/libclang-cpp.so.16+0x1a19229) #20 0x00007ef953aecfb0 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/libclang-cpp.so.16+0x8ecfb0) #21 0x00007ef95531e7c9 clang::FrontendAction::Execute() (/usr/lib/libclang-cpp.so.16+0x211e7c9) #22 0x00007ef9552c0d2f clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/libclang-cpp.so.16+0x20c0d2f) #23 0x00007ef95537bf02 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/libclang-cpp.so.16+0x217bf02) #24 0x00006008867b1a6f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang+++0x14a6f) #25 0x00006008867b5b10 (/usr/bin/clang+++0x18b10) #26 0x00007ef954fec779 (/usr/lib/libclang-cpp.so.16+0x1dec779) #27 0x00007ef94bb08c87 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/lib/libLLVM-16.so+0xd08c87) #28 0x00007ef954ff30c4 (/usr/lib/libclang-cpp.so.16+0x1df30c4) #29 0x00007ef955011431 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/usr/lib/libclang-cpp.so.16+0x1e11431) #30 0x00007ef9550117ed clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/usr/lib/libclang-cpp.so.16+0x1e117ed) #31 0x00007ef9550155dc clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/usr/lib/libclang-cpp.so.16+0x1e155dc) #32 0x00006008867b899f clang_main(int, char**) (/usr/bin/clang+++0x1b99f) #33 0x00007ef94a845cd0 (/usr/lib/libc.so.6+0x27cd0) #34 0x00007ef94a845d8a __libc_start_main (/usr/lib/libc.so.6+0x27d8a) #35 0x00006008867a9ed5 _start (/usr/bin/clang+++0xced5) clang-16: error: clang frontend command failed with exit code 70 (use -v to see invocation) clang version 16.0.6 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin clang-16: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-16: note: diagnostic msg: /tmp/testpathutil-d50ae4.cpp clang-16: note: diagnostic msg: /tmp/testpathutil-d50ae4.sh clang-16: note: diagnostic msg: ``` Mentioned files: [testpathutil-d50ae4.zip](https://github.com/llvm/llvm-project/files/14186437/testpathutil-d50ae4.zip) Not preprocessed code (https://github.com/google/googletest/releases/tag/release-1.12.1 is used): ```c++ #include <gtest/gtest.h> #include <stdexcept> #include <string_view> namespace VFS::Path { struct NormalizedView { template <std::size_t size> constexpr NormalizedView(const char (&value)[size]) { throw std::invalid_argument(value); } }; namespace { using namespace testing; template <class T> struct NormalizedOperatorsTest : Test { }; TYPED_TEST_SUITE_P(NormalizedOperatorsTest); TYPED_TEST_P(NormalizedOperatorsTest, supportsEqual) { const TypeParam otherEqual{ "a/foo/bar/baz" }; } REGISTER_TYPED_TEST_SUITE_P(NormalizedOperatorsTest, supportsEqual); using NormalizedOperatorsParams = Types<const char[14], NormalizedView>; INSTANTIATE_TYPED_TEST_SUITE_P(StringTypes, NormalizedOperatorsTest, NormalizedOperatorsParams); } } ``` The same code on the compiler explorer causing the error for comparison with other compilers: https://godbolt.org/z/Kd81djbds
topperc commented 9 months ago

When I run the IR through llc I get this error

./bin/llc: error: ./bin/llc: test.ll:2123:128: error: invalid cast opcode for cast from '[14 x i8]' to 'ptr'
  invoke void @_ZNSt16invalid_argumentC2B8ne190000EPKc(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull bitcast ([14 x i8] c"a/foo/bar/baz\00" to ptr))

So the IR is malformed before it reaches the backend.

topperc commented 9 months ago

Switching to an assertions build fails in clang https://godbolt.org/z/4b6EGq7s3

clang++: /root/llvm-project/clang/lib/CodeGen/CGCall.cpp:4660: void clang::CodeGen::CodeGenFunction::EmitCallArg(clang::CodeGen::CallArgList&, const clang::Expr*, clang::QualType): Assertion `type->isReferenceType() == E->isGLValue() && "reference binding to unmaterialized r-value!"' failed.
llvmbot commented 9 months ago

@llvm/issue-subscribers-clang-codegen

Author: Roman Siromakha (elsid)

Compiler output: ``` fatal error: error in backend: Cannot select: 0x6008887851f0: i64 = bitcast Constant:i8<97> 0x600887b2f890: i8 = Constant<97> In function: _ZN3VFS4Path12_GLOBAL__N_136gtest_suite_NormalizedOperatorsTest_13supportsEqualINS0_14NormalizedViewEE8TestBodyEv 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++ -march=native -Wall -Wextra -Wundef -Wextra-semi -Wno-unused-parameter -pedantic -Wno-long-long -Wnon-virtual-dtor -Wunused -Wno-potentially-evaluated-expression -Og -std=c++20 -DBOOST_NO_CXX11_SCOPED_ENUMS=ON -DBT_USE_DOUBLE_PRECISION -DMYGUI_DONT_REPLACE_NULLPTR -DOPENMW_DATA_DIR=u8\"/home/elsid/dev/openmw/build/clang/fast/apps/openmw_test_suite/data\" -DOPENMW_PROJECT_SOURCE_DIR=u8\"/home/elsid/dev/openmw\" -D__STDC_CONSTANT_MACROS -I/home/elsid/dev/openmw/extern/Base64/. -I/home/elsid/dev/openmw/extern/smhasher/. -isystem /home/elsid/dev/icu/build/clang/release/install/include -isystem /home/elsid/dev/openmw/extern/sol_config -isystem /home/elsid/dev/openmw/extern/sol3 -isystem /home/elsid/dev/LuaJIT/build/clang/release/install/include/luajit-2.1 -isystem /home/elsid/dev/bullet3/build/clang/release/install/include/bullet -isystem /usr/include/AL -isystem /home/elsid/dev/mygui/build/clang/release/install/include/MYGUI -isystem /home/elsid/dev/boost/build/clang/release/boost_1_83_0/install/include -isystem /home/elsid/dev/openmw/. -isystem /home/elsid/dev/OpenSceneGraph/build/clang/release/install/include -isystem /home/elsid/dev/googletest/build/clang/release/install/include -isystem /usr/include/SDL2 -isystem /home/elsid/dev/recastnavigation/build/clang/release/install/include/recastnavigation -isystem /home/elsid/dev/yaml-cpp/build/clang/release/install/include -stdlib=libc++ -DNDEBUG -c -MD -MT apps/openmw_test_suite/CMakeFiles/openmw_test_suite.dir/vfs/testpathutil.cpp.o -MF CMakeFiles/openmw_test_suite.dir/vfs/testpathutil.cpp.o.d -fcolor-diagnostics -o CMakeFiles/openmw_test_suite.dir/vfs/testpathutil.cpp.o /home/elsid/dev/openmw/apps/openmw_test_suite/vfs/testpathutil.cpp 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module '/home/elsid/dev/openmw/apps/openmw_test_suite/vfs/testpathutil.cpp'. 4. Running pass 'X86 DAG->DAG Instruction Selection' on function '@_ZN3VFS4Path12_GLOBAL__N_136gtest_suite_NormalizedOperatorsTest_13supportsEqualINS0_14NormalizedViewEE8TestBodyEv' #0 0x00007ef94bc1f503 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/libLLVM-16.so+0xe1f503) #1 0x00007ef94bc1c7bf llvm::sys::RunSignalHandlers() (/usr/lib/libLLVM-16.so+0xe1c7bf) #2 0x00007ef94bb08d9a llvm::CrashRecoveryContext::HandleExit(int) (/usr/lib/libLLVM-16.so+0xd08d9a) #3 0x00007ef94bc158d4 llvm::sys::Process::Exit(int, bool) (/usr/lib/libLLVM-16.so+0xe158d4) #4 0x00006008867ac463 (/usr/bin/clang+++0xf463) #5 0x00007ef94bb1f002 llvm::report_fatal_error(llvm::Twine const&, bool) (/usr/lib/libLLVM-16.so+0xd1f002) #6 0x00007ef94c6fad4a llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/usr/lib/libLLVM-16.so+0x18fad4a) #7 0x00007ef94c6fd7ba llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/usr/lib/libLLVM-16.so+0x18fd7ba) #8 0x00007ef94f7885f8 (/usr/lib/libLLVM-16.so+0x49885f8) #9 0x00007ef94c6f7f5c llvm::SelectionDAGISel::DoInstructionSelection() (/usr/lib/libLLVM-16.so+0x18f7f5c) #10 0x00007ef94c70268c llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/usr/lib/libLLVM-16.so+0x190268c) #11 0x00007ef94c70592d llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/usr/lib/libLLVM-16.so+0x190592d) #12 0x00007ef94c7079b6 (/usr/lib/libLLVM-16.so+0x19079b6) #13 0x00007ef94f78efb7 (/usr/lib/libLLVM-16.so+0x498efb7) #14 0x00007ef94c0ea945 (/usr/lib/libLLVM-16.so+0x12ea945) #15 0x00007ef94bdab989 llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/lib/libLLVM-16.so+0xfab989) #16 0x00007ef94bdabd34 llvm::FPPassManager::runOnModule(llvm::Module&) (/usr/lib/libLLVM-16.so+0xfabd34) #17 0x00007ef94bdac6ac llvm::legacy::PassManagerImpl::run(llvm::Module&) (/usr/lib/libLLVM-16.so+0xfac6ac) #18 0x00007ef9548f3fb3 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/usr/lib/libclang-cpp.so.16+0x16f3fb3) #19 0x00007ef954c19229 (/usr/lib/libclang-cpp.so.16+0x1a19229) #20 0x00007ef953aecfb0 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/libclang-cpp.so.16+0x8ecfb0) #21 0x00007ef95531e7c9 clang::FrontendAction::Execute() (/usr/lib/libclang-cpp.so.16+0x211e7c9) #22 0x00007ef9552c0d2f clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/libclang-cpp.so.16+0x20c0d2f) #23 0x00007ef95537bf02 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/libclang-cpp.so.16+0x217bf02) #24 0x00006008867b1a6f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang+++0x14a6f) #25 0x00006008867b5b10 (/usr/bin/clang+++0x18b10) #26 0x00007ef954fec779 (/usr/lib/libclang-cpp.so.16+0x1dec779) #27 0x00007ef94bb08c87 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/lib/libLLVM-16.so+0xd08c87) #28 0x00007ef954ff30c4 (/usr/lib/libclang-cpp.so.16+0x1df30c4) #29 0x00007ef955011431 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/usr/lib/libclang-cpp.so.16+0x1e11431) #30 0x00007ef9550117ed clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/usr/lib/libclang-cpp.so.16+0x1e117ed) #31 0x00007ef9550155dc clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/usr/lib/libclang-cpp.so.16+0x1e155dc) #32 0x00006008867b899f clang_main(int, char**) (/usr/bin/clang+++0x1b99f) #33 0x00007ef94a845cd0 (/usr/lib/libc.so.6+0x27cd0) #34 0x00007ef94a845d8a __libc_start_main (/usr/lib/libc.so.6+0x27d8a) #35 0x00006008867a9ed5 _start (/usr/bin/clang+++0xced5) clang-16: error: clang frontend command failed with exit code 70 (use -v to see invocation) clang version 16.0.6 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin clang-16: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-16: note: diagnostic msg: /tmp/testpathutil-d50ae4.cpp clang-16: note: diagnostic msg: /tmp/testpathutil-d50ae4.sh clang-16: note: diagnostic msg: ``` Mentioned files: [testpathutil-d50ae4.zip](https://github.com/llvm/llvm-project/files/14186437/testpathutil-d50ae4.zip) Not preprocessed code (https://github.com/google/googletest/releases/tag/release-1.12.1 is used): ```c++ #include <gtest/gtest.h> #include <stdexcept> #include <string_view> namespace VFS::Path { struct NormalizedView { template <std::size_t size> constexpr NormalizedView(const char (&value)[size]) { throw std::invalid_argument(value); } }; namespace { using namespace testing; template <class T> struct NormalizedOperatorsTest : Test { }; TYPED_TEST_SUITE_P(NormalizedOperatorsTest); TYPED_TEST_P(NormalizedOperatorsTest, supportsEqual) { const TypeParam otherEqual{ "a/foo/bar/baz" }; } REGISTER_TYPED_TEST_SUITE_P(NormalizedOperatorsTest, supportsEqual); using NormalizedOperatorsParams = Types<const char[14], NormalizedView>; INSTANTIATE_TYPED_TEST_SUITE_P(StringTypes, NormalizedOperatorsTest, NormalizedOperatorsParams); } } ``` The same code on the compiler explorer causing the error for comparison with other compilers: https://godbolt.org/z/Kd81djbds