[llvm-bugs] [Bug 46950] New: ICE: UNREACHABLE executed at llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:6481!

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Aug 1 13:18:59 PDT 2020


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

            Bug ID: 46950
           Summary: ICE: UNREACHABLE executed at
                    llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:6481!
           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

Error:
>$ clang++ -O2 func.cpp -c
Instr did not go through cost modelling?
UNREACHABLE executed at llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:6481!
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++ -O2 func.cpp -c 
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'Function Pass Manager' on module 'func.cpp'.
4.      Running pass 'Loop Vectorization' on function '@_Z4testv'
 #0 0x000055e4c6f287fe llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(clang-12+0x23de7fe)
 #1 0x000055e4c6f265d4 llvm::sys::RunSignalHandlers() (clang-12+0x23dc5d4)
 #2 0x000055e4c6f26851 llvm::sys::CleanupOnSignal(unsigned long)
(clang-12+0x23dc851)
 #3 0x000055e4c6e93248 CrashRecoverySignalHandler(int) (clang-12+0x2349248)
 #4 0x00007f910ef56540 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x15540)
 #5 0x00007f910e9eb3eb raise
/build/glibc-5mDdLG/glibc-2.30/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #6 0x00007f910e9ca899 abort /build/glibc-5mDdLG/glibc-2.30/stdlib/abort.c:81:7
 #7 0x000055e4c6e9b03e (clang-12+0x235103e)
 #8 0x000055e4c70c5104
llvm::LoopVectorizationCostModel::getInstructionCost(llvm::Instruction*,
unsigned int,
llvm::Type*&)::'lambda'(llvm::Instruction*)::operator()(llvm::Instruction*)
const (.isra.0) (clang-12+0x257b104)
 #9 0x000055e4c70d8e7e
llvm::LoopVectorizationCostModel::getInstructionCost(llvm::Instruction*,
unsigned int, llvm::Type*&) (clang-12+0x258ee7e)
#10 0x000055e4c70dd825
llvm::LoopVectorizationCostModel::getInstructionCost(llvm::Instruction*,
unsigned int) (.localalias) (clang-12+0x2593825)
#11 0x000055e4c70de673 llvm::LoopVectorizationCostModel::expectedCost(unsigned
int) (clang-12+0x2594673)
#12 0x000055e4c70deb39
llvm::LoopVectorizationCostModel::selectVectorizationFactor(unsigned int)
(clang-12+0x2594b39)
#13 0x000055e4c70f1a0c llvm::LoopVectorizationPlanner::plan(unsigned int,
unsigned int) (clang-12+0x25a7a0c)
#14 0x000055e4c70f435e llvm::LoopVectorizePass::processLoop(llvm::Loop*)
(clang-12+0x25aa35e)
#15 0x000055e4c70f6d60 llvm::LoopVectorizePass::runImpl(llvm::Function&,
llvm::ScalarEvolution&, llvm::LoopInfo&, llvm::TargetTransformInfo&,
llvm::DominatorTree&, llvm::BlockFrequencyInfo&, llvm::TargetLibraryInfo*,
llvm::DemandedBits&, llvm::AAResults&, llvm::AssumptionCache&,
std::function<llvm::LoopAccessInfo const& (llvm::Loop&)>&,
llvm::OptimizationRemarkEmitter&, llvm::ProfileSummaryInfo*)
(clang-12+0x25acd60)
#16 0x000055e4c70f71f7 (anonymous
namespace)::LoopVectorize::runOnFunction(llvm::Function&) (clang-12+0x25ad1f7)
#17 0x000055e4c685d911 llvm::FPPassManager::runOnFunction(llvm::Function&)
(clang-12+0x1d13911)
#18 0x000055e4c685e009 llvm::FPPassManager::runOnModule(llvm::Module&)
(clang-12+0x1d14009)
#19 0x000055e4c685caac llvm::legacy::PassManagerImpl::run(llvm::Module&)
(clang-12+0x1d12aac)
#20 0x000055e4c71d4bb9 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >) (clang-12+0x268abb9)
#21 0x000055e4c71d66b5 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_delete<llvm::raw_pwrite_stream> >) (clang-12+0x268c6b5)
#22 0x000055e4c7ed4781
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(clang-12+0x338a781)
#23 0x000055e4c8d15cb9 clang::ParseAST(clang::Sema&, bool, bool)
(clang-12+0x41cbcb9)
#24 0x000055e4c7ed31c8 clang::CodeGenAction::ExecuteAction()
(clang-12+0x33891c8)
#25 0x000055e4c7808389 clang::FrontendAction::Execute() (clang-12+0x2cbe389)
#26 0x000055e4c77bf066
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(clang-12+0x2c75066)
#27 0x000055e4c78dc780
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (clang-12+0x2d92780)
#28 0x000055e4c57a4a71 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (clang-12+0xc5aa71)
#29 0x000055e4c57a1da8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(clang-12+0xc57da8)
#30 0x000055e4c767e289 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) (clang-12+0x2b34289)
#31 0x000055e4c6e933cc
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(clang-12+0x23493cc)
#32 0x000055e4c767eba6
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) (clang-12+0x2b34ba6)
#33 0x000055e4c76560fc
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const (clang-12+0x2b0c0fc)
#34 0x000055e4c7656a36
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(clang-12+0x2b0ca36)
#35 0x000055e4c765fdb9
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(clang-12+0x2b15db9)
#36 0x000055e4c5723279 main (clang-12+0xbd9279)
#37 0x00007f910e9cc1e3 __libc_start_main
/build/glibc-5mDdLG/glibc-2.30/csu/../csu/libc-start.c:342:3
#38 0x000055e4c57a18fe _start (clang-12+0xc578fe)
clang-12: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 12.0.0 (https://github.com/llvm/llvm-project.git
3b0d30ffd30a704d09a34031d8797e22b708caab)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /bin

Reproducer:
extern int var_1;
extern unsigned short var_13;
extern int arr_3[25];
extern long arr_117[];
void test() {
  for (short a = 0; a < 10; a = 505)
    for (; 0 < (char)var_1;)
      for (;;)
        for (int b = var_13; b < 20; b += var_13)
          arr_117[b] = b ? 0 : arr_3[a];

Clang version:
12.0.0 (https://github.com/llvm/llvm-project.git
3b0d30ffd30a704d09a34031d8797e22b708caab)

-- 
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/20200801/f56ce1f5/attachment.html>


More information about the llvm-bugs mailing list