You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /tmp/small-ff86e5.c
clang-13: note: diagnostic msg: /tmp/small-ff86e5.sh
clang-13: note: diagnostic msg:
$clang -v
clang version 13.0.0 (https://github.com/llvm/llvm-project7fb4001)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/haoxin/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Candidate multilib: .;@m64
Selected multilib: .;@m64
Thanks.
Haoxin
The text was updated successfully, but these errors were encountered:
Extended Description
Hi all.
This program makes clang-trunk crash under O2~Os options.
$cat small.c
#include <stdint.h>
void a() {
uint64_t *b;
uint64_t *c;
uint32_t d;
uint64_t *e;
if (*c) {
for (; e <= 7; e++) {
int64_t f = 0;
c = f;
}
if (*e /= e <= c) {
uint64_t g;
for (d = 7; d;) {
uint32_t *j = &d;
i:
(*j = g) != (*c ?: d ?: *b == 0);
if (d = c > 0)
g = 0;
}
}
for (; d;)
;
}
goto i;
}
$clang -c -w -O2 small.c
clang: /home/haoxin/haoxin-data/dut-research/compilers/llvm-project/llvm/include/llvm/ADT/Optional.h:197: T& llvm::optional_detail::OptionalStorage<T, true>::getValue() & [with T = llvm::AliasResult]: Assertion `hasVal' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: clang -c -w -O2 small.c
#0 0x000055f89bec1b7c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x33fbb7c)
#1 0x000055f89bebf7b4 llvm::sys::RunSignalHandlers() (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x33f97b4)
#2 0x000055f89bebfa4b llvm::sys::CleanupOnSignal(unsigned long) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x33f9a4b)
#3 0x000055f89be1e998 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#4 0x00007f3a57158980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
#5 0x00007f3a55d80fb7 raise /build/glibc-S9d2JN/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#6 0x00007f3a55d82921 abort /build/glibc-S9d2JN/glibc-2.27/stdlib/abort.c:81:0
#7 0x00007f3a55d7248a __assert_fail_base /build/glibc-S9d2JN/glibc-2.27/assert/assert.c:89:0
#8 0x00007f3a55d72502 (/lib/x86_64-linux-gnu/libc.so.6+0x30502)
#9 0x000055f89ae49010 llvm::BasicAAResult::aliasPHI(llvm::PHINode const*, llvm::LocationSize, llvm::AAMDNodes const&, llvm::Value const*, llvm::LocationSize, llvm::AAMDNodes const&, llvm::AAQueryInfo&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x2383010)
#10 0x000055f89ae491d1 llvm::BasicAAResult::aliasCheckRecursive(llvm::Value const*, llvm::LocationSize, llvm::AAMDNodes const&, llvm::Value const*, llvm::LocationSize, llvm::AAMDNodes const&, llvm::AAQueryInfo&, llvm::Value const*, llvm::Value const*) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x23831d1)
#11 0x000055f89ae4614b llvm::BasicAAResult::aliasCheck(llvm::Value const*, llvm::LocationSize, llvm::AAMDNodes const&, llvm::Value const*, llvm::LocationSize, llvm::AAMDNodes const&, llvm::AAQueryInfo&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x238014b)
#12 0x000055f89ae466db llvm::BasicAAResult::alias(llvm::MemoryLocation const&, llvm::MemoryLocation const&, llvm::AAQueryInfo&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x23806db)
#13 0x000055f89ae1e38b llvm::AAResults::alias(llvm::MemoryLocation const&, llvm::MemoryLocation const&, llvm::AAQueryInfo&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x235838b)
#14 0x000055f89ae489f2 llvm::BasicAAResult::aliasPHI(llvm::PHINode const*, llvm::LocationSize, llvm::AAMDNodes const&, llvm::Value const*, llvm::LocationSize, llvm::AAMDNodes const&, llvm::AAQueryInfo&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x23829f2)
#15 0x000055f89ae491d1 llvm::BasicAAResult::aliasCheckRecursive(llvm::Value const*, llvm::LocationSize, llvm::AAMDNodes const&, llvm::Value const*, llvm::LocationSize, llvm::AAMDNodes const&, llvm::AAQueryInfo&, llvm::Value const*, llvm::Value const*) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x23831d1)
#16 0x000055f89ae4614b llvm::BasicAAResult::aliasCheck(llvm::Value const*, llvm::LocationSize, llvm::AAMDNodes const&, llvm::Value const*, llvm::LocationSize, llvm::AAMDNodes const&, llvm::AAQueryInfo&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x238014b)
#17 0x000055f89ae466db llvm::BasicAAResult::alias(llvm::MemoryLocation const&, llvm::MemoryLocation const&, llvm::AAQueryInfo&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x23806db)
#18 0x000055f89ae1e38b llvm::AAResults::alias(llvm::MemoryLocation const&, llvm::MemoryLocation const&, llvm::AAQueryInfo&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x235838b)
#19 0x000055f89ae1ff02 llvm::AAResults::getModRefInfo(llvm::StoreInst const*, llvm::MemoryLocation const&, llvm::AAQueryInfo&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x2359f02)
#20 0x000055f89ae2005e llvm::AAResults::getModRefInfo(llvm::StoreInst const*, llvm::MemoryLocation const&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x235a05e)
#21 0x000055f89af3fbfa llvm::FindAvailablePtrLoadStore(llvm::Value*, llvm::Type*, bool, llvm::BasicBlock*, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, false>&, unsigned int, llvm::AAResults*, bool*, unsigned int*) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x2479bfa)
#22 0x000055f89af41132 llvm::FindAvailableLoadedValue(llvm::LoadInst*, llvm::BasicBlock*, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, false>&, unsigned int, llvm::AAResults*, bool*, unsigned int*) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x247b132)
#23 0x000055f89bc1c8c5 llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(llvm::LoadInst*) (.part.785) JumpThreading.cpp:0:0
#24 0x000055f89bc231ec llvm::JumpThreadingPass::processBlock(llvm::BasicBlock*) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x315d1ec)
#25 0x000055f89bc23dbe llvm::JumpThreadingPass::runImpl(llvm::Function&, llvm::TargetLibraryInfo*, llvm::LazyValueInfo*, llvm::AAResults*, llvm::DomTreeUpdater*, bool, std::unique_ptr<llvm::BlockFrequencyInfo, std::default_deletellvm::BlockFrequencyInfo >, std::unique_ptr<llvm::BranchProbabilityInfo, std::default_deletellvm::BranchProbabilityInfo >) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x315ddbe)
#26 0x000055f89bc25244 llvm::JumpThreadingPass::run(llvm::Function&, llvm::AnalysisManagerllvm::Function&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x315f244)
#27 0x000055f89ce482e1 llvm::detail::PassModel<llvm::Function, llvm::JumpThreadingPass, llvm::PreservedAnalyses, llvm::AnalysisManagerllvm::Function >::run(llvm::Function&, llvm::AnalysisManagerllvm::Function&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x43822e1)
#28 0x000055f89b6cad45 llvm::PassManager<llvm::Function, llvm::AnalysisManagerllvm::Function >::run(llvm::Function&, llvm::AnalysisManagerllvm::Function&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x2c04d45)
#29 0x000055f899d8e801 llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManagerllvm::Function >, llvm::PreservedAnalyses, llvm::AnalysisManagerllvm::Function >::run(llvm::Function&, llvm::AnalysisManagerllvm::Function&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x12c8801)
#30 0x000055f89ae89308 llvm::CGSCCToFunctionPassAdaptor::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x23c3308)
#31 0x000055f899d8f151 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::CGSCCToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x12c9151)
#32 0x000055f89ae8192a llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x23bb92a)
#33 0x000055f89b7c9d51 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x2d03d51)
#34 0x000055f89ae853a6 llvm::DevirtSCCRepeatedPass::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x23bf3a6)
#35 0x000055f89b7c9d11 llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::DevirtSCCRepeatedPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x2d03d11)
#36 0x000055f89ae832f7 llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&, llvm::AnalysisManagerllvm::Module&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x23bd2f7)
#37 0x000055f89b7c9d91 llvm::detail::PassModel<llvm::Module, llvm::ModuleToPostOrderCGSCCPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManagerllvm::Module >::run(llvm::Module&, llvm::AnalysisManagerllvm::Module&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x2d03d91)
#38 0x000055f89b6c9155 llvm::PassManager<llvm::Module, llvm::AnalysisManagerllvm::Module >::run(llvm::Module&, llvm::AnalysisManagerllvm::Module&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x2c03155)
#39 0x000055f89b7ccabf llvm::ModuleInlinerWrapperPass::run(llvm::Module&, llvm::AnalysisManagerllvm::Module&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x2d06abf)
#40 0x000055f89ce49b31 llvm::detail::PassModel<llvm::Module, llvm::ModuleInlinerWrapperPass, llvm::PreservedAnalyses, llvm::AnalysisManagerllvm::Module >::run(llvm::Module&, llvm::AnalysisManagerllvm::Module&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x4383b31)
#41 0x000055f89b6c9155 llvm::PassManager<llvm::Module, llvm::AnalysisManagerllvm::Module >::run(llvm::Module&, llvm::AnalysisManagerllvm::Module&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x2c03155)
#42 0x000055f89c17dd4b (anonymous namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_deletellvm::raw_pwrite_stream >) BackendUtil.cpp:0:0
#43 0x000055f89c182045 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_deletellvm::raw_pwrite_stream >) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x36bc045)
#44 0x000055f89cde8c3b clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x4322c3b)
#45 0x000055f89d948409 clang::ParseAST(clang::Sema&, bool, bool) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x4e82409)
#46 0x000055f89cde79b8 clang::CodeGenAction::ExecuteAction() (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x43219b8)
#47 0x000055f89c781e09 clang::FrontendAction::Execute() (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x3cbbe09)
#48 0x000055f89c71f7a1 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x3c597a1)
#49 0x000055f89c849ab0 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x3d83ab0)
#50 0x000055f899afcb34 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x1036b34)
#51 0x000055f899af9097 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#52 0x000055f89c5d56a5 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optionalllvm::StringRef >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool) const::'lambda'()>(long) Job.cpp:0:0
#53 0x000055f89be1eb12 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x3358b12)
#54 0x000055f89c5d69ec clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optionalllvm::StringRef >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool) const (.part.186) Job.cpp:0:0
#55 0x000055f89c5aebc9 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x3ae8bc9)
#56 0x000055f89c5af6a7 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x3ae96a7)
#57 0x000055f89c5b8509 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x3af2509)
#58 0x000055f899a2895e main (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0xf6295e)
#59 0x00007f3a55d63bf7 __libc_start_main /build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:344:0
#60 0x000055f899af8b1a _start (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin/clang-13+0x1032b1a)
clang-13: error: clang frontend command failed with exit code 134 (use -v to see invocation)
clang version 13.0.0 (https://github.com/llvm/llvm-project 7fb4001)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/haoxin/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin
clang-13: note: diagnostic msg:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /tmp/small-ff86e5.c
clang-13: note: diagnostic msg: /tmp/small-ff86e5.sh
clang-13: note: diagnostic msg:
$clang -v
clang version 13.0.0 (https://github.com/llvm/llvm-project 7fb4001)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/haoxin/haoxin-data/dut-research/compilers/llvm-project/build-20210228/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Candidate multilib: .;@m64
Selected multilib: .;@m64
Thanks.
Haoxin
The text was updated successfully, but these errors were encountered: