[llvm-bugs] [Bug 34430] New: clang crashes with "-mllvm -enable-newgvn": Assertion `ProcessedCount[V] < 100 && "Seem to have processed the same Value a lot"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Sep 2 15:47:36 PDT 2017


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

            Bug ID: 34430
           Summary: clang crashes with "-mllvm -enable-newgvn": Assertion
                    `ProcessedCount[V] < 100 && "Seem to have processed
                    the same Value a lot"' failed
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: helloqirun at gmail.com
                CC: llvm-bugs at lists.llvm.org

The symptom is exactly the same as that in bug 33432, after r312401.


$ clang-trunk -v
clang version 6.0.0 (trunk 312410)
Target: x86_64-unknown-linux-gnu
Thread model: posix

$ clang-trunk -mllvm -enable-newgvn abc.c -O2
clang-6.0: /home/absozero/trunk/llvm/lib/Transforms/Scalar/NewGVN.cpp:2837:
void {anonymous}::NewGVN::updateProcessedCount(const llvm::Value*): Assertion
`ProcessedCount[V] < 100 && "Seem to have processed the same Value a lot"'
failed.
#0 0x00000000022a9c1a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x22a9c1a)
#1 0x00000000022a7dae llvm::sys::RunSignalHandlers()
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x22a7dae)
#2 0x00000000022a7f10 SignalHandler(int)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x22a7f10)
#3 0x00007fef3a8c9340 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10340)
#4 0x00007fef396bacc9 gsignal
/build/buildd/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007fef396be0d8 abort /build/buildd/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007fef396b3b86 __assert_fail_base
/build/buildd/eglibc-2.19/assert/assert.c:92:0
#7 0x00007fef396b3c32 (/lib/x86_64-linux-gnu/libc.so.6+0x2fc32)
#8 0x00000000021a6300 (anonymous
namespace)::NewGVN::updateProcessedCount(llvm::Value const*)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x21a6300)
#9 0x00000000021b205e (anonymous
namespace)::NewGVN::iterateTouchedInstructions()
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x21b205e)
#10 0x00000000021b3b88 (anonymous namespace)::NewGVN::runGVN()
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x21b3b88)
#11 0x00000000021b5957 (anonymous
namespace)::NewGVNLegacyPass::runOnFunction(llvm::Function&) [clone .part.1772]
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x21b5957)
#12 0x0000000001e26e43 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x1e26e43)
#13 0x00000000018ca2a6 (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x18ca2a6)
#14 0x0000000001e2775a llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x1e2775a)
#15 0x00000000024494f5 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x24494f5)
#16 0x000000000244a8d3 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> >)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x244a8d3)
#17 0x0000000002b6ab4f
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x2b6ab4f)
#18 0x0000000002f7a43c clang::ParseAST(clang::Sema&, bool, bool)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x2f7a43c)
#19 0x0000000002b69ff0 clang::CodeGenAction::ExecuteAction()
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x2b69ff0)
#20 0x00000000027fecf6 clang::FrontendAction::Execute()
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x27fecf6)
#21 0x00000000027d1956
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x27d1956)
#22 0x000000000289a8b2
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x289a8b2)
#23 0x0000000000cc3328 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/absozero/trunk/root-clang/bin/clang-6.0+0xcc3328)
#24 0x0000000000c5a82c main
(/home/absozero/trunk/root-clang/bin/clang-6.0+0xc5a82c)
#25 0x00007fef396a5ec5 __libc_start_main
/build/buildd/eglibc-2.19/csu/libc-start.c:321:0
#26 0x0000000000cbec59 _start
(/home/absozero/trunk/root-clang/bin/clang-6.0+0xcbec59)
Stack dump:
0.      Program arguments: /home/absozero/trunk/root-clang/bin/clang-6.0 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name abc.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -resource-dir
/home/absozero/trunk/root-clang/lib/clang/6.0.0 -c-isystem
/usr/local/include/csmith-2.3.0 -c-isystem /usr/local/include/csmith-2.3.0
-c-isystem . -cxx-isystem /usr/local/include/csmith-2.3.0 -cxx-isystem
/usr/local/include/csmith-2.3.0 -cxx-isystem . -internal-isystem
/usr/local/include -internal-isystem
/home/absozero/trunk/root-clang/lib/clang/6.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O2
-fdebug-compilation-dir /home/absozero/projects/reduction -ferror-limit 19
-fmessage-length 172 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -vectorize-slp -mllvm -enable-newgvn -o
/tmp/abc-42201f.o -x c abc.c
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'CallGraph Pass Manager' on module 'abc.c'.
4.      Running pass 'Global Value Numbering' on function '@fn1'
clang-6.0: error: unable to execute command: Aborted (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (trunk 312410)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-6.0: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-6.0: note: diagnostic msg: /tmp/abc-dcff2d.c
clang-6.0: note: diagnostic msg: /tmp/abc-dcff2d.sh
clang-6.0: note: diagnostic msg:

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


$ cat abc.c
long a;
int b, d;
char c;
void fn1() {
  for (; b;) {
    char e = 5;
    if (c) {
      d = 5;
      for (; d <= 8;)
        (d -= 2) ? e %= e : 6;
      for (; e <= 6;)
        for (; a;)
        l1:;
    }
    goto l1;
  }
  goto l1;
}

-- 
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/20170902/b724fa83/attachment.html>


More information about the llvm-bugs mailing list