[llvm-bugs] [Bug 52002] New: BDCE with -fopenmp-simd -O3: Assertion `materialized_use_empty() && "Uses remain when a value is destroyed!"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 28 11:44:41 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=52002

            Bug ID: 52002
           Summary: BDCE with -fopenmp-simd -O3: Assertion
                    `materialized_use_empty() && "Uses remain when a value
                    is destroyed!"' failed
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: Vsevolod.Livinskij at frtk.ru
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Reproducer:
extern char var_13;
extern char arr_7[][3];
void test() {
#pragma omp simd
  for (char a = 0; a < 3; a += var_13 + 2)
    arr_7[a][2] = 0;
}

Error:
>$ clang++ -fopenmp-simd -O3 -c func.cpp
While deleting: i64 %
Use still stuck around after Def is destroyed:  %2 = mul i64 %indvars.iv,
<badref>
clang++: /testing/llvm/llvm_src/llvm/lib/IR/Value.cpp:103:
llvm::Value::~Value(): Assertion `materialized_use_empty() && "Uses remain when
a value is destroyed!"' 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++ -fopenmp-simd -O3 -c func.cpp
1.      <eof> parser at end of file
2.      Optimizer
 #0 0x0000563430cc89c4 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x0000563430cc67c4 llvm::sys::CleanupOnSignal(unsigned long)
(/testing/llvm/bin/bin/clang-14+0x24697c4)
 #2 0x0000563430c0dba8 CrashRecoverySignalHandler(int)
CrashRecoveryContext.cpp:0:0
 #3 0x00007f5deecab3c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #4 0x00007f5dee75d18b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4618b)
 #5 0x00007f5dee73c859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x25859)
 #6 0x00007f5dee73c729 (/lib/x86_64-linux-gnu/libc.so.6+0x25729)
 #7 0x00007f5dee74df36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #8 0x00005634304e5b40 llvm::Value::~Value()
(/testing/llvm/bin/bin/clang-14+0x1c88b40)
 #9 0x00005634304e5bb2 llvm::Value::deleteValue()
(/testing/llvm/bin/bin/clang-14+0x1c88bb2)
#10 0x0000563430430569 llvm::Instruction::eraseFromParent()
(/testing/llvm/bin/bin/clang-14+0x1bd3569)
#11 0x000056343098f8a4 bitTrackingDCE(llvm::Function&, llvm::DemandedBits&)
BDCE.cpp:0:0
#12 0x0000563430990438 llvm::BDCEPass::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
(/testing/llvm/bin/bin/clang-14+0x2133438)
#13 0x00005634322666d6 llvm::detail::PassModel<llvm::Function, llvm::BDCEPass,
llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>
>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&)
(/testing/llvm/bin/bin/clang-14+0x3a096d6)
#14 0x00005634304c4e06 llvm::PassManager<llvm::Function,
llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
(/testing/llvm/bin/bin/clang-14+0x1c67e06)
#15 0x0000563430ff6546 llvm::detail::PassModel<llvm::Function,
llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >,
llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>
>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&)
(/testing/llvm/bin/bin/clang-14+0x2799546)
#16 0x000056343425701f
llvm::CGSCCToFunctionPassAdaptor::run(llvm::LazyCallGraph::SCC&,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&)
(/testing/llvm/bin/bin/clang-14+0x59fa01f)
#17 0x0000563432264476 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&)
(/testing/llvm/bin/bin/clang-14+0x3a07476)
#18 0x000056343424ed3b 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&)
(/testing/llvm/bin/bin/clang-14+0x59f1d3b)
#19 0x00005634305ef886 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&)
(/testing/llvm/bin/bin/clang-14+0x1d92886)
#20 0x0000563434252bc4
llvm::DevirtSCCRepeatedPass::run(llvm::LazyCallGraph::SCC&,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&)
(/testing/llvm/bin/bin/clang-14+0x59f5bc4)
#21 0x00005634305ef836 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&)
(/testing/llvm/bin/bin/clang-14+0x1d92836)
#22 0x0000563434250893
llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/testing/llvm/bin/bin/clang-14+0x59f3893)
#23 0x00005634305ef8d6 llvm::detail::PassModel<llvm::Module,
llvm::ModuleToPostOrderCGSCCPassAdaptor, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/testing/llvm/bin/bin/clang-14+0x1d928d6)
#24 0x00005634304c133f llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/testing/llvm/bin/bin/clang-14+0x1c6433f)
#25 0x00005634305f2e21 llvm::ModuleInlinerWrapperPass::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/testing/llvm/bin/bin/clang-14+0x1d95e21)
#26 0x0000563431eff3e6 llvm::detail::PassModel<llvm::Module,
llvm::ModuleInlinerWrapperPass, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/testing/llvm/bin/bin/clang-14+0x36a23e6)
#27 0x00005634304c133f llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/testing/llvm/bin/bin/clang-14+0x1c6433f)
#28 0x0000563431006406 (anonymous
namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >) BackendUtil.cpp:0:0
#29 0x000056343100b615 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> >)
(/testing/llvm/bin/bin/clang-14+0x27ae615)
#30 0x0000563431e7dfff
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/testing/llvm/bin/bin/clang-14+0x3620fff)
#31 0x0000563432fe31a9 clang::ParseAST(clang::Sema&, bool, bool)
(/testing/llvm/bin/bin/clang-14+0x47861a9)
#32 0x0000563431e7cb38 clang::CodeGenAction::ExecuteAction()
(/testing/llvm/bin/bin/clang-14+0x361fb38)
#33 0x0000563431730c79 clang::FrontendAction::Execute()
(/testing/llvm/bin/bin/clang-14+0x2ed3c79)
#34 0x00005634316c1ade
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/testing/llvm/bin/bin/clang-14+0x2e64ade)
#35 0x0000563431810580
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/testing/llvm/bin/bin/clang-14+0x2fb3580)
#36 0x000056342f798147 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/testing/llvm/bin/bin/clang-14+0xf3b147)
#37 0x000056342f7945e8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#38 0x0000563431548f39 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#39 0x0000563430c0dd2c
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/testing/llvm/bin/bin/clang-14+0x23b0d2c)
#40 0x000056343154964d
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const (.part.0) Job.cpp:0:0
#41 0x000056343151b2fb
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/testing/llvm/bin/bin/clang-14+0x2cbe2fb)
#42 0x000056343151be09
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/testing/llvm/bin/bin/clang-14+0x2cbee09)
#43 0x0000563431527679
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/testing/llvm/bin/bin/clang-14+0x2cca679)
#44 0x000056342f70eba6 main (/testing/llvm/bin/bin/clang-14+0xeb1ba6)
#45 0x00007f5dee73e0b3 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b3)
#46 0x000056342f79415e _start (/testing/llvm/bin/bin/clang-14+0xf3715e)
clang-14: error: clang frontend command failed with exit code 134 (use -v to
see invocation)
clang version 14.0.0 (https://github.com/llvm/llvm-project.git
be610932fa068ed2228b0f694ae80c9294f0293f)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /testing/llvm/bin/bin
clang-14: note: diagnostic msg: 
********************

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

********************

LLVM version:
clang version 14.0.0 (https://github.com/llvm/llvm-project.git
be610932fa068ed2228b0f694ae80c9294f0293f)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210928/319834c3/attachment-0001.html>


More information about the llvm-bugs mailing list