| Issue |
167326
|
| Summary |
[X86][GlobalISel] clang crashed at -O1/O2/O3
|
| Labels |
llvm:globalisel
|
| Assignees |
|
| Reporter |
XChy
|
Reproducer: https://godbolt.org/z/Ebece6co7
Testcase:
```c
#include <stdint.h>
#define BS_VEC(type, num) type __attribute__((vector_size(num * sizeof(type))))
int16_t backsmith_pure_2(uint64_t BS_ARG_1, uint16_t BS_ARG_5) {
uint16_t BS_VAR_2;
BS_VEC(int32_t, 16)
BS_VAR_3 = __builtin_convertvector(
(BS_VEC(uint64_t, 16)){BS_ARG_1, BS_ARG_1, BS_ARG_1, BS_ARG_1, BS_ARG_1,
BS_ARG_1, BS_ARG_1},
BS_VEC(int32_t, 16));
BS_VAR_2 = BS_ARG_5 >= (_BitInt(75))BS_VAR_3[6];
return BS_VAR_2;
}
```
clang output:
```
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 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -O1 -mllvm -global-isel -mllvm -global-isel-abort=2 <source>
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module '<source>'.
4. Running pass 'Legalizer' on function '@backsmith_pure_2'
#0 0x000000000424f278 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x424f278)
#1 0x000000000424c6a4 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x424c6a4)
#2 0x0000000004190908 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007ac900e42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00000000055e6f7b llvm::LegalizationArtifactCombiner::tryCombineTrunc(llvm::MachineInstr&, llvm::SmallVectorImpl<llvm::MachineInstr*>&, llvm::SmallVectorImpl<llvm::Register>&, llvm::GISelObserverWrapper&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x55e6f7b)
#5 0x00000000055ea558 llvm::Legalizer::legalizeMachineFunction(llvm::MachineFunction&, llvm::LegalizerInfo const&, llvm::ArrayRef<llvm::GISelChangeObserver*>, llvm::LostDebugLocObserver&, llvm::MachineIRBuilder&, llvm::GISelValueTracking*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x55ea558)
#6 0x00000000055ebe0e llvm::Legalizer::runOnMachineFunction(llvm::MachineFunction&) (.part.0) Legalizer.cpp:0:0
#7 0x00000000034fff99 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#8 0x0000000003b49e26 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3b49e26)
#9 0x0000000003b4a1d1 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3b4a1d1)
#10 0x0000000003b4aa3f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3b4aa3f)
#11 0x0000000004510a36 clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, 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*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4510a36)
#12 0x0000000004b9b8d7 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4b9b8d7)
#13 0x000000000694c15c clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x694c15c)
#14 0x0000000004b9bd38 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4b9bd38)
#15 0x0000000004e8a285 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4e8a285)
#16 0x0000000004e0b08e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4e0b08e)
#17 0x0000000004f8242d clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4f8242d)
#18 0x0000000000dd3d00 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xdd3d00)
#19 0x0000000000dca87a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#20 0x0000000000dca9fd int llvm::function_ref<int (llvm::SmallVectorImpl<char const*>&)>::callback_fn<clang_main(int, char**, llvm::ToolContext const&)::'lambda'(llvm::SmallVectorImpl<char const*>&)>(long, llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#21 0x0000000004c05bb9 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
#22 0x0000000004190da4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4190da4)
#23 0x0000000004c061cf 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
#24 0x0000000004bc6c22 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4bc6c22)
#25 0x0000000004bc7bce 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+0x4bc7bce)
#26 0x0000000004bcf325 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4bcf325)
#27 0x0000000000dd0221 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xdd0221)
#28 0x0000000000c7e7b4 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xc7e7b4)
#29 0x00007ac900e29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#30 0x00007ac900e29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#31 0x0000000000dca315 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xdca315)
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs