[llvm-bugs] [Bug 35020] New: clang crashes at -O1 and above with -fexperimental-new-pass-manager: Assertion `!UR.InvalidatedSCCs.count(C) && "Processing an invalid SCC!"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 20 22:05:32 PDT 2017


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

            Bug ID: 35020
           Summary: clang crashes at -O1 and above with
                    -fexperimental-new-pass-manager: Assertion
                    `!UR.InvalidatedSCCs.count(C) && "Processing an
                    invalid SCC!"' failed
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: su at cs.ucdavis.edu
                CC: llvm-bugs at lists.llvm.org

Tested with trunk rev. 316243. 

$ clangpolly -v
clang version 6.0.0 (http://llvm.org/git/clang.git
d6aede0fad127fa8eedd339e9594bf30cbd98294) (llvm/trunk 316219)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.2.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ 
$ clangpolly -O1 -c -w small.c
$ 
$ clangpolly -fexperimental-new-pass-manager -O1 -c -w small.c
clang-6.0:
/home/su/software/tmp/polly/llvm/include/llvm/Analysis/CGSCCPassManager.h:742:
llvm::PreservedAnalyses
llvm::DevirtSCCRepeatedPass<PassT>::run(llvm::LazyCallGraph::SCC&,
llvm::CGSCCAnalysisManager&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&)
[with PassT = llvm::PassManager<llvm::LazyCallGraph::SCC,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>; llvm::CGSCCAnalysisManager =
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>]:
Assertion `!UR.InvalidatedSCCs.count(C) && "Processing an invalid SCC!"'
failed.
#0 0x000000000234324a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/su/software/tmp/polly/llvm/lib/Support/Unix/Signals.inc:402:0
#1 0x00000000023413ee llvm::sys::RunSignalHandlers()
/home/su/software/tmp/polly/llvm/lib/Support/Signals.cpp:50:0
#2 0x0000000002341550 SignalHandler(int)
/home/su/software/tmp/polly/llvm/lib/Support/Unix/Signals.inc:242:0
#3 0x00007fa95fd8d330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007fa95eb75c37 gsignal
/build/eglibc-SvCtMH/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007fa95eb79028 abort
/build/eglibc-SvCtMH/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007fa95eb6ebf6 __assert_fail_base
/build/eglibc-SvCtMH/eglibc-2.19/assert/assert.c:92:0
#7 0x00007fa95eb6eca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x0000000003d1f9a5
llvm::DevirtSCCRepeatedPass<llvm::PassManager<llvm::LazyCallGraph::SCC,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC<llvm::LazyCallGraph&> >,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>
>::run(llvm::LazyCallGraph::SCC&,
llvm::LazyCallGraph::SCC<llvm::LazyCallGraph&>&, llvm::LazyCallGraph&,
llvm::CGSCCUpdateResult)
/home/su/software/tmp/polly/llvm/include/llvm/Analysis/CGSCCPassManager.h:820:0
#9 0x0000000003d22356
llvm::ModuleToPostOrderCGSCCPassAdaptor<llvm::DevirtSCCRepeatedPass<llvm::PassManager<llvm::LazyCallGraph::SCC,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&> > >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
/home/su/software/tmp/polly/llvm/include/llvm/Analysis/CGSCCPassManager.h:433:0
#10 0x0000000003d2267d llvm::detail::PassModel<llvm::Module,
llvm::ModuleToPostOrderCGSCCPassAdaptor<llvm::DevirtSCCRepeatedPass<llvm::PassManager<llvm::LazyCallGraph::SCC,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC<llvm::LazyCallGraph&> >,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&> > >, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Module<> >>::run(llvm::Module&,
llvm::PreservedAnalyses&)
/home/su/software/tmp/polly/llvm/include/llvm/IR/PassManagerInternal.h:81:0
#11 0x0000000001ef2513 llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
/home/su/software/tmp/polly/llvm/include/llvm/IR/PassManager.h:460:0
#12 0x0000000003cd658d llvm::detail::PassModel<llvm::Module,
llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module<> >>,
llvm::PreservedAnalyses, llvm::Module<><> >::run(llvm::Module&,
llvm::Module<>&)
/home/su/software/tmp/polly/llvm/include/llvm/IR/PassManagerInternal.h:81:0
#13 0x0000000001ef2513 llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
/home/su/software/tmp/polly/llvm/include/llvm/IR/PassManager.h:460:0
#14 0x00000000024d5885 (anonymous
namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:977:0
#15 0x00000000024d8405 ~unique_ptr /usr/include/c++/4.9/bits/unique_ptr.h:235:0
#16 0x00000000024d8405 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/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:1143:0
#17 0x0000000002cf596c ~unique_ptr /usr/include/c++/4.9/bits/unique_ptr.h:235:0
#18 0x0000000002cf596c
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:294:0
#19 0x0000000002ed257c swap<bool> /usr/include/c++/4.9/bits/move.h:177:0
#20 0x0000000002ed257c clang::ParseAST(clang::Sema&, bool, bool)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Parse/ParseAST.cpp:161:0
#21 0x0000000002cf4e00 clang::CodeGenAction::ExecuteAction()
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1032:0
#22 0x000000000289271e clang::FrontendAction::Execute()
/home/su/software/tmp/polly/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:897:0
#23 0x0000000002866516
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:992:0
#24 0x0000000002929b71
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/su/software/tmp/polly/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#25 0x0000000000d83a58 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#26 0x0000000000d104c3 ExecuteCC1Tool
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/driver.cpp:309:0
#27 0x0000000000d104c3 main
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/driver.cpp:388:0
#28 0x00007fa95eb60f45 __libc_start_main
/build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:321:0
#29 0x0000000000d7fc99 _start
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0xd7fc99)
Stack dump:
0.      Program arguments: /home/su/software/tmp/polly/llvm_build/bin/clang-6.0
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name
small.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 -coverage-notes-file
/home/su/specres/20171020-clangpolly-m32-fexperimental-new-pass-manager-O3-build-055134/delta/small.gcno
-resource-dir /home/su/software/tmp/polly/llvm_build/lib/clang/6.0.0
-internal-isystem /usr/local/include -internal-isystem
/home/su/software/tmp/polly/llvm_build/lib/clang/6.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O1
-w -fdebug-compilation-dir
/home/su/specres/20171020-clangpolly-m32-fexperimental-new-pass-manager-O3-build-055134/delta
-ferror-limit 19 -fmessage-length 116 -fexperimental-new-pass-manager
-fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o small.o -x
c small.c 
1.      <eof> parser at end of file
2.      Optimizer
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 (http://llvm.org/git/clang.git
d6aede0fad127fa8eedd339e9594bf30cbd98294) (llvm/trunk 316219)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/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/small-2893a4.c
clang-6.0: note: diagnostic msg: /tmp/small-2893a4.sh
clang-6.0: note: diagnostic msg: 

********************
$ 


------------------------------


int a, b, c;

int fn1 (int);

static int fn2 ()
{
  fn1 (0);
  fn2 ();
  return b;
}

int fn1 (int f)
{
  int g = 0;
  for (; g < 4; g++)
    g &= a > fn1 (0);
  fn2 ();
  return c;
}

-- 
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/20171021/c1d74732/attachment.html>


More information about the llvm-bugs mailing list