-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Open
Bug
Copy link
Labels
crash-on-validllvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesregression
Description
Compiler Explorer: https://godbolt.org/z/9bbozcWxa
Also see: #150338
[586] % clangtk -v
clang version 22.0.0git (https://github.com/llvm/llvm-project.git 2b8696b58e25f53f23d35a3904c111c1ae61d6f4)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /local/home/suz/suz-local/software/local/clang-trunk/bin
Build config: +assertions
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
Candidate multilib: .;@m64
Selected multilib: .;@m64
Found CUDA installation: /usr/local/cuda, version 12.1
[587] %
[587] % clangtk -O1 -w -c small.c
clangtk: /local/suz-local/software/clangbuild/llvm-project/llvm/include/llvm/IR/Value.h:357: llvm::Value::use_iterator llvm::Value::materialized_use_begin(): Assertion `hasUseList()' failed.
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: clangtk -I/usr/local/include -I/local/suz-local/software/local/include -O1 -w -c small.c
1. <eof> parser at end of file
2. Optimizer
3. Running pass "function<eager-inv>(mem2reg,instcombine<max-iterations=1;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;no-sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>)" on module "small.c"
4. Running pass "instcombine<max-iterations=1;no-verify-fixpoint>" on function "d"
#0 0x000055fa34769c30 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x4221c30)
#1 0x000055fa347668df llvm::sys::RunSignalHandlers() (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x421e8df)
#2 0x000055fa346a6d88 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007f2000d17520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007f2000d6b9fc __pthread_kill_implementation ./nptl/./nptl/pthread_kill.c:44:76
#5 0x00007f2000d6b9fc __pthread_kill_internal ./nptl/./nptl/pthread_kill.c:78:10
#6 0x00007f2000d6b9fc pthread_kill ./nptl/./nptl/pthread_kill.c:89:10
#7 0x00007f2000d17476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#8 0x00007f2000cfd7f3 abort ./stdlib/./stdlib/abort.c:81:7
#9 0x00007f2000cfd71b _nl_load_domain ./intl/./intl/loadmsgcat.c:1177:9
#10 0x00007f2000d0ee96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#11 0x000055fa336532b9 (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x310b2b9)
#12 0x000055fa3485b5f1 llvm::wouldInstructionBeTriviallyDead(llvm::Instruction const*, llvm::TargetLibraryInfo const*) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x43135f1)
#13 0x000055fa342a0410 llvm::InstCombinerImpl::run() (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x3d58410)
#14 0x000055fa342a20ba combineInstructionsOverFunction(llvm::Function&, llvm::InstructionWorklist&, llvm::AAResults*, llvm::AssumptionCache&, llvm::TargetLibraryInfo&, llvm::TargetTransformInfo&, llvm::DominatorTree&, llvm::OptimizationRemarkEmitter&, llvm::BlockFrequencyInfo*, llvm::BranchProbabilityInfo*, llvm::ProfileSummaryInfo*, llvm::InstCombineOptions const&) InstructionCombining.cpp:0:0
#15 0x000055fa342a3490 llvm::InstCombinePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x3d5b490)
#16 0x000055fa34a06da6 llvm::detail::PassModel<llvm::Function, llvm::InstCombinePass, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x44beda6)
#17 0x000055fa340c0827 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x3b78827)
#18 0x000055fa318312c6 llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x12e92c6)
#19 0x000055fa340c0d99 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x3b78d99)
#20 0x000055fa318319b6 llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x12e99b6)
#21 0x000055fa340beb44 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x3b76b44)
#22 0x000055fa34a15bf3 (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >&, std::unique_ptr<llvm::ToolOutputFile, std::default_delete<llvm::ToolOutputFile> >&, clang::BackendConsumer*) BackendUtil.cpp:0:0
#23 0x000055fa34a1a193 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*) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x44d2193)
#24 0x000055fa3510c5cf clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x4bc45cf)
#25 0x000055fa36b59c5c clang::ParseAST(clang::Sema&, bool, bool) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x6611c5c)
#26 0x000055fa354292a9 clang::FrontendAction::Execute() (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x4ee12a9)
#27 0x000055fa353a4cf5 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x4e5ccf5)
#28 0x000055fa35519668 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x4fd1668)
#29 0x000055fa313b6103 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0xe6e103)
#30 0x000055fa313ac69a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#31 0x000055fa3517b71d 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
#32 0x000055fa346a7230 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x415f230)
#33 0x000055fa3517bfbe 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
#34 0x000055fa35139531 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x4bf1531)
#35 0x000055fa3513a651 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&, bool) const (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x4bf2651)
#36 0x000055fa35146ec4 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0x4bfeec4)
#37 0x000055fa313b1fb7 clang_main(int, char**, llvm::ToolContext const&) (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0xe69fb7)
#38 0x000055fa3127e9eb main (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0xd369eb)
#39 0x00007f2000cfed90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#40 0x00007f2000cfee40 call_init ./csu/../csu/libc-start.c:128:20
#41 0x00007f2000cfee40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#42 0x000055fa313abdc5 _start (/local/home/suz/suz-local/software/local/clang-trunk/bin/clang-22+0xe63dc5)
clangtk: error: clang frontend command failed with exit code 134 (use -v to see invocation)
clang version 22.0.0git (https://github.com/llvm/llvm-project.git 2b8696b58e25f53f23d35a3904c111c1ae61d6f4)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /local/home/suz/suz-local/software/local/clang-trunk/bin
Build config: +assertions
clangtk: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clangtk: note: diagnostic msg: /tmp/small-2b299c.c
clangtk: note: diagnostic msg: /tmp/small-2b299c.sh
clangtk: note: diagnostic msg:
********************
[588] %
[588] % cat small.c
int h;
static int *a, **b = &a;
int c() { return h; }
int *d() {
int e = *a;
if (c())
f : {
int g;
if (e)
return &g;
b = 0;
}
goto f;
}
Metadata
Metadata
Assignees
Labels
crash-on-validllvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesregression
Type
Projects
Status
No status