[llvm-bugs] [Bug 38804] New: clang crashes with "-mllvm -enable-newgvn" at -O2: Assertion `F->user_begin() == F->user_end() && "PredicateInfo consumer did not remove all SSA copies."' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Sep 1 20:28:33 PDT 2018


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

            Bug ID: 38804
           Summary: clang crashes with "-mllvm -enable-newgvn" at -O2:
                    Assertion `F->user_begin() == F->user_end() &&
                    "PredicateInfo consumer did not remove all SSA
                    copies."' 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

clang-r337827: first working build
clang-r337828: next failing build


$ clang-trunk -v
clang version 8.0.0 (trunk 341273)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin


$ clang-trunk -mllvm -enable-newgvn -O2 abc.c
clang-8: /home/absozero/trunk/llvm/lib/Transforms/Utils/PredicateInfo.cpp:735:
llvm::PredicateInfo::~PredicateInfo(): Assertion `F->user_begin() ==
F->user_end() && "PredicateInfo consumer did not remove all SSA copies."'
failed.
Stack dump:
0.      Program arguments: /home/absozero/trunk/root-clang/bin/clang-8 -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
-dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -resource-dir
/home/absozero/trunk/root-clang/lib/clang/8.0.0 -internal-isystem
/usr/local/include -internal-isystem
/home/absozero/trunk/root-clang/lib/clang/8.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/crash -ferror-limit
19 -fmessage-length 141 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -vectorize-slp -mllvm -enable-newgvn -o
/tmp/abc-c56121.o -x c abc.c -faddrsig
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 '@g'
#0 0x00000000021297b4 PrintStackTraceSignalHandler(void*)
(/home/absozero/trunk/root-clang/bin/clang-8+0x21297b4)
#1 0x000000000212765e llvm::sys::RunSignalHandlers()
(/home/absozero/trunk/root-clang/bin/clang-8+0x212765e)
#2 0x0000000002129972 SignalHandler(int)
(/home/absozero/trunk/root-clang/bin/clang-8+0x2129972)
#3 0x00007fefc4744330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007fefc331fc37 gsignal
/build/eglibc-ripdx6/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007fefc3323028 abort
/build/eglibc-ripdx6/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007fefc3318bf6 __assert_fail_base
/build/eglibc-ripdx6/eglibc-2.19/assert/assert.c:92:0
#7 0x00007fefc3318ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x00000000021d187e llvm::PredicateInfo::~PredicateInfo()
(/home/absozero/trunk/root-clang/bin/clang-8+0x21d187e)
#9 0x0000000001fe45b3 (anonymous namespace)::NewGVN::~NewGVN()
(/home/absozero/trunk/root-clang/bin/clang-8+0x1fe45b3)
#10 0x0000000001fe5a13 (anonymous
namespace)::NewGVNLegacyPass::runOnFunction(llvm::Function&)
(/home/absozero/trunk/root-clang/bin/clang-8+0x1fe5a13)
#11 0x0000000001bce19b llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/absozero/trunk/root-clang/bin/clang-8+0x1bce19b)
#12 0x00000000015eca27 (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&)
(/home/absozero/trunk/root-clang/bin/clang-8+0x15eca27)
#13 0x0000000001bcea1b llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/absozero/trunk/root-clang/bin/clang-8+0x1bcea1b)
#14 0x0000000002304a7b 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-8+0x2304a7b)
#15 0x0000000002c525cf
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/absozero/trunk/root-clang/bin/clang-8+0x2c525cf)
#16 0x000000000324d355 clang::ParseAST(clang::Sema&, bool, bool)
(/home/absozero/trunk/root-clang/bin/clang-8+0x324d355)
#17 0x00000000027c7cd0 clang::FrontendAction::Execute()
(/home/absozero/trunk/root-clang/bin/clang-8+0x27c7cd0)
#18 0x000000000276f8c1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/absozero/trunk/root-clang/bin/clang-8+0x276f8c1)
#19 0x000000000286bc89
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/absozero/trunk/root-clang/bin/clang-8+0x286bc89)
#20 0x00000000009336d8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/absozero/trunk/root-clang/bin/clang-8+0x9336d8)
#21 0x0000000000930f1a main
(/home/absozero/trunk/root-clang/bin/clang-8+0x930f1a)
#22 0x00007fefc330af45 __libc_start_main
/build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:321:0
#23 0x000000000092de8d _start
(/home/absozero/trunk/root-clang/bin/clang-8+0x92de8d)
clang-8: error: unable to execute command: Aborted (core dumped)
clang-8: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 8.0.0 (trunk 341273)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-8: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang-8: note: diagnostic msg:
********************

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

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

$ cat abc.c
char a, e;
int b, c, d;
short f;
void g() {
  for (; c;)
    ;
  for (; d;)
    ;
  if (c)
    ;
  else {
    b = 0;
    for (; b <= 0; b++)
      if (e)
        break;
  }
  if (b == a)
    f = b;
}

-- 
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/20180902/974c52a1/attachment-0001.html>


More information about the llvm-bugs mailing list