<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - clang crash: llvm/include/llvm/Support/Casting.h:104: static bool llvm::isa_impl_cl<llvm::Instruction, const llvm::Value *>::doit(const From *) [To = llvm::Instruction, From = const llvm::Value *]: Assertion `Val && "isa<> used on a null pointer"' failed"
   href="https://bugs.llvm.org/show_bug.cgi?id=49786">49786</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang crash: llvm/include/llvm/Support/Casting.h:104: static bool llvm::isa_impl_cl<llvm::Instruction, const llvm::Value *>::doit(const From *) [To = llvm::Instruction, From = const llvm::Value *]: Assertion `Val && "isa<> used on a null pointer"' failed
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Scalar Optimizations
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>haoxintu@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi all.

This program makes clang crash at -O1 in the current trunk version of clang.

$cat small.c
#include <stdint.h>
int a, b, c;
void d() {
  int e, f;
  int16_t g = a;
  uint64_t l;
  for (; g;) {
    uint64_t *i;
    uint32_t j = 4;
    for (5; c;) {
      int32_t n = &e;
      n++;
    }
    for (; e;) {
      uint64_t o = &i;
      for (;;) {
        if (o ?: c) {
          for (;;)
            ;
        k:;
        }
      }
    }
    for (; l;)
      if (b) {
        int64_t p;
        for (*i = 4; i; i++) {
          for (; p;)
            ;
          for (e = 8; e;)
            for (; j;)
              goto k;
        }
        {
          uint16_t q;
          if (b) {
            int64_t m;
            int64_t *r = m;
          s:
            m = 0;
            i = r;
            *r = 0;
          }
          if (l ^= 3) {
            for (; b; q |= *i)
              ;
            for (; f;)
              ;
          }
        }
        if (*i)
          goto s;
      }
  }
  goto s;
}


$clang -w -O1 small.c
clang-13:
/home/tuhaoxin/github/llvm-project/llvm/include/llvm/Support/Casting.h:104:
static bool llvm::isa_impl_cl<llvm::Instruction, const llvm::Value
*>::doit(const From *) [To = llvm::Instruction, From = const llvm::Value *]:
Assertion `Val && "isa<> used on a null pointer"' failed.
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments:
/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj --mrelax-relocations -disable-free
-main-file-name small.c -mrelocation-model static -mframe-pointer=none
-fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb
-fcoverage-compilation-dir=/home/tuhaoxin/dut-research/covsmith-test/20210330/3
-resource-dir
/home/tuhaoxin/github/llvm-project/build-20210330/lib/clang/13.0.0 -c-isystem
/usr/local/include/csmith-2.4.0 -cxx-isystem /usr/local/include/csmith-2.4.0
-internal-isystem
/home/tuhaoxin/github/llvm-project/build-20210330/lib/clang/13.0.0/include
-internal-isystem /usr/local/include -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/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/tuhaoxin/dut-research/covsmith-test/20210330/3
-ferror-limit 19 -fgnuc-version=4.2.1 -fcolor-diagnostics -faddrsig
-D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/small-dd8064.o -x c small.c
1.      <eof> parser at end of file
2.      Optimizer
 #0 0x0000000002a62123 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x2a62123)
 #1 0x0000000002a5fe6e llvm::sys::RunSignalHandlers()
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x2a5fe6e)
 #2 0x0000000002a625ef SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f5b43a093c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #4 0x00007f5b4349e18b raise
/build/glibc-ZN95T4/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x00007f5b4347d859 abort /build/glibc-ZN95T4/glibc-2.31/stdlib/abort.c:81:7
 #6 0x00007f5b4347d729 get_sysdep_segment_value
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:509:8
 #7 0x00007f5b4347d729 _nl_load_domain
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:970:34
 #8 0x00007f5b4348ef36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #9 0x0000000001bf1b5c llvm::Loop::isLoopInvariant(llvm::Value const*) const
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x1bf1b5c)
#10 0x00000000027fb6ce bool
__gnu_cxx::__ops::_Iter_pred<collectPromotionCandidates(llvm::MemorySSA*,
llvm::AAResults*, llvm::Loop*,
llvm::SmallVectorImpl<llvm::Instruction*>&)::$_14>::operator()<llvm::Instruction**>(llvm::Instruction**)
LICM.cpp:0:0
#11 0x00000000027ef2e4 (anonymous
namespace)::LoopInvariantCodeMotion::runOnLoop(llvm::Loop*, llvm::AAResults*,
llvm::LoopInfo*, llvm::DominatorTree*, llvm::BlockFrequencyInfo*,
llvm::TargetLibraryInfo*, llvm::TargetTransformInfo*, llvm::ScalarEvolution*,
llvm::MemorySSA*, llvm::OptimizationRemarkEmitter*) LICM.cpp:0:0
#12 0x00000000027edd72 llvm::LICMPass::run(llvm::Loop&,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x27edd72)
#13 0x0000000003a2e16d llvm::detail::PassModel<llvm::Loop, llvm::LICMPass,
llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Loop,
llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&,
llvm::LPMUpdater&>::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop,
llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&,
llvm::LPMUpdater&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3a2e16d)
#14 0x0000000003b065ef llvm::Optional<llvm::PreservedAnalyses>
llvm::PassManager<llvm::Loop, llvm::AnalysisManager<llvm::Loop,
llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&,
llvm::LPMUpdater&>::runSinglePass<llvm::Loop,
std::unique_ptr<llvm::detail::PassConcept<llvm::Loop,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>,
std::default_delete<llvm::detail::PassConcept<llvm::Loop,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&> > > >(llvm::Loop&,
std::unique_ptr<llvm::detail::PassConcept<llvm::Loop,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>,
std::default_delete<llvm::detail::PassConcept<llvm::Loop,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&> > >&,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&,
llvm::PassInstrumentation&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3b065ef)
#15 0x0000000003b06356 llvm::PassManager<llvm::Loop,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>,
llvm::LoopStandardAnalysisResults&,
llvm::LPMUpdater&>::runWithoutLoopNestPasses(llvm::Loop&,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3b06356)
#16 0x0000000003b05a1f llvm::PassManager<llvm::Loop,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>::run(llvm::Loop&,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3b05a1f)
#17 0x0000000003a237ad llvm::detail::PassModel<llvm::Loop,
llvm::PassManager<llvm::Loop, llvm::AnalysisManager<llvm::Loop,
llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&,
llvm::LPMUpdater&>, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Loop,
llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&,
llvm::LPMUpdater&>::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop,
llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&,
llvm::LPMUpdater&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3a237ad)
#18 0x0000000003b0777b llvm::FunctionToLoopPassAdaptor::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3b0777b)
#19 0x0000000003a2f33d llvm::detail::PassModel<llvm::Function,
llvm::FunctionToLoopPassAdaptor, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3a2f33d)
#20 0x00000000022df5a5 llvm::PassManager<llvm::Function,
llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x22df5a5)
#21 0x0000000000c2825d llvm::detail::PassModel<llvm::Function,
llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >,
llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>
<span class="quote">>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&)</span >
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0xc2825d)
#22 0x0000000001b119c4
llvm::CGSCCToFunctionPassAdaptor::run(llvm::LazyCallGraph::SCC&,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x1b119c4)
#23 0x0000000000c29d3d 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&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0xc29d3d)
#24 0x0000000001b0c1d1 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&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x1b0c1d1)
#25 0x00000000023e5e6d 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&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x23e5e6d)
#26 0x0000000001b0ffbc
llvm::DevirtSCCRepeatedPass::run(llvm::LazyCallGraph::SCC&,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x1b0ffbc)
#27 0x00000000023e634d 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&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x23e634d)
#28 0x0000000001b0e6c3
llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x1b0e6c3)
#29 0x00000000023e619d llvm::detail::PassModel<llvm::Module,
llvm::ModuleToPostOrderCGSCCPassAdaptor, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x23e619d)
#30 0x00000000022de458 llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x22de458)
#31 0x00000000023e3b2e llvm::ModuleInlinerWrapperPass::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x23e3b2e)
#32 0x0000000003a3326d llvm::detail::PassModel<llvm::Module,
llvm::ModuleInlinerWrapperPass, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3a3326d)
#33 0x00000000022de458 llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x22de458)
#34 0x0000000002ccf1d8 (anonymous
namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >) BackendUtil.cpp:0:0
#35 0x0000000002cc8824 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/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x2cc8824)
#36 0x0000000003973250
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3973250)
#37 0x0000000004319de3 clang::ParseAST(clang::Sema&, bool, bool)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x4319de3)
#38 0x00000000032ed5d3 clang::FrontendAction::Execute()
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x32ed5d3)
#39 0x0000000003260b43
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3260b43)
#40 0x000000000339b692
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x339b692)
#41 0x00000000009dc6e0 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x9dc6e0)
#42 0x00000000009da582 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#43 0x00000000009da224 main
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x9da224)
#44 0x00007f5b4347f0b3 __libc_start_main
/build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:342:3
#45 0x00000000009d718e _start
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x9d718e)
clang-13: error: unable to execute command: Aborted (core dumped)
clang-13: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 13.0.0 (<a href="https://github.com/llvm/llvm-project">https://github.com/llvm/llvm-project</a>
5127da029194bbe32421c336b6f249241b658a2b)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/tuhaoxin/github/llvm-project/build-20210330/bin
clang-13: note: diagnostic msg: 
********************

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

********************
tuhaoxin@oscar-2020:~/dut-research/covsmith-test/20210330/3$ vim  small.c
tuhaoxin@oscar-2020:~/dut-research/covsmith-test/20210330/3$ clang -w -O1
small.c
clang-13:
/home/tuhaoxin/github/llvm-project/llvm/include/llvm/Support/Casting.h:104:
static bool llvm::isa_impl_cl<llvm::Instruction, const llvm::Value
*>::doit(const From *) [To = llvm::Instruction, From = const llvm::Value *]:
Assertion `Val && "isa<> used on a null pointer"' failed.
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments:
/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj --mrelax-relocations -disable-free
-main-file-name small.c -mrelocation-model static -mframe-pointer=none
-fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb
-fcoverage-compilation-dir=/home/tuhaoxin/dut-research/covsmith-test/20210330/3
-resource-dir
/home/tuhaoxin/github/llvm-project/build-20210330/lib/clang/13.0.0 -c-isystem
/usr/local/include/csmith-2.4.0 -cxx-isystem /usr/local/include/csmith-2.4.0
-internal-isystem
/home/tuhaoxin/github/llvm-project/build-20210330/lib/clang/13.0.0/include
-internal-isystem /usr/local/include -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/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/tuhaoxin/dut-research/covsmith-test/20210330/3
-ferror-limit 19 -fgnuc-version=4.2.1 -fcolor-diagnostics -faddrsig
-D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/small-bb9a22.o -x c small.c
1.      <eof> parser at end of file
2.      Optimizer
 #0 0x0000000002a62123 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x2a62123)
 #1 0x0000000002a5fe6e llvm::sys::RunSignalHandlers()
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x2a5fe6e)
 #2 0x0000000002a625ef SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f60a862f3c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #4 0x00007f60a80c418b raise
/build/glibc-ZN95T4/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x00007f60a80a3859 abort /build/glibc-ZN95T4/glibc-2.31/stdlib/abort.c:81:7
 #6 0x00007f60a80a3729 get_sysdep_segment_value
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:509:8
 #7 0x00007f60a80a3729 _nl_load_domain
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:970:34
 #8 0x00007f60a80b4f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #9 0x0000000001bf1b5c llvm::Loop::isLoopInvariant(llvm::Value const*) const
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x1bf1b5c)
#10 0x00000000027fb6ce bool
__gnu_cxx::__ops::_Iter_pred<collectPromotionCandidates(llvm::MemorySSA*,
llvm::AAResults*, llvm::Loop*,
llvm::SmallVectorImpl<llvm::Instruction*>&)::$_14>::operator()<llvm::Instruction**>(llvm::Instruction**)
LICM.cpp:0:0
#11 0x00000000027ef2e4 (anonymous
namespace)::LoopInvariantCodeMotion::runOnLoop(llvm::Loop*, llvm::AAResults*,
llvm::LoopInfo*, llvm::DominatorTree*, llvm::BlockFrequencyInfo*,
llvm::TargetLibraryInfo*, llvm::TargetTransformInfo*, llvm::ScalarEvolution*,
llvm::MemorySSA*, llvm::OptimizationRemarkEmitter*) LICM.cpp:0:0
#12 0x00000000027edd72 llvm::LICMPass::run(llvm::Loop&,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x27edd72)
#13 0x0000000003a2e16d llvm::detail::PassModel<llvm::Loop, llvm::LICMPass,
llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Loop,
llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&,
llvm::LPMUpdater&>::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop,
llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&,
llvm::LPMUpdater&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3a2e16d)
#14 0x0000000003b065ef llvm::Optional<llvm::PreservedAnalyses>
llvm::PassManager<llvm::Loop, llvm::AnalysisManager<llvm::Loop,
llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&,
llvm::LPMUpdater&>::runSinglePass<llvm::Loop,
std::unique_ptr<llvm::detail::PassConcept<llvm::Loop,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>,
std::default_delete<llvm::detail::PassConcept<llvm::Loop,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&> > > >(llvm::Loop&,
std::unique_ptr<llvm::detail::PassConcept<llvm::Loop,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>,
std::default_delete<llvm::detail::PassConcept<llvm::Loop,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&> > >&,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&,
llvm::PassInstrumentation&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3b065ef)
#15 0x0000000003b06356 llvm::PassManager<llvm::Loop,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>,
llvm::LoopStandardAnalysisResults&,
llvm::LPMUpdater&>::runWithoutLoopNestPasses(llvm::Loop&,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3b06356)
#16 0x0000000003b05a1f llvm::PassManager<llvm::Loop,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>::run(llvm::Loop&,
llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&,
llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3b05a1f)
#17 0x0000000003a237ad llvm::detail::PassModel<llvm::Loop,
llvm::PassManager<llvm::Loop, llvm::AnalysisManager<llvm::Loop,
llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&,
llvm::LPMUpdater&>, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Loop,
llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&,
llvm::LPMUpdater&>::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop,
llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&,
llvm::LPMUpdater&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3a237ad)
#18 0x0000000003b0777b llvm::FunctionToLoopPassAdaptor::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3b0777b)
#19 0x0000000003a2f33d llvm::detail::PassModel<llvm::Function,
llvm::FunctionToLoopPassAdaptor, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3a2f33d)
#20 0x00000000022df5a5 llvm::PassManager<llvm::Function,
llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x22df5a5)
#21 0x0000000000c2825d llvm::detail::PassModel<llvm::Function,
llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >,
llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>
<span class="quote">>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&)</span >
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0xc2825d)
#22 0x0000000001b119c4
llvm::CGSCCToFunctionPassAdaptor::run(llvm::LazyCallGraph::SCC&,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x1b119c4)
#23 0x0000000000c29d3d 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&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0xc29d3d)
#24 0x0000000001b0c1d1 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&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x1b0c1d1)
#25 0x00000000023e5e6d 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&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x23e5e6d)
#26 0x0000000001b0ffbc
llvm::DevirtSCCRepeatedPass::run(llvm::LazyCallGraph::SCC&,
llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&,
llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x1b0ffbc)
#27 0x00000000023e634d 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&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x23e634d)
#28 0x0000000001b0e6c3
llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x1b0e6c3)
#29 0x00000000023e619d llvm::detail::PassModel<llvm::Module,
llvm::ModuleToPostOrderCGSCCPassAdaptor, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x23e619d)
#30 0x00000000022de458 llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x22de458)
#31 0x00000000023e3b2e llvm::ModuleInlinerWrapperPass::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x23e3b2e)
#32 0x0000000003a3326d llvm::detail::PassModel<llvm::Module,
llvm::ModuleInlinerWrapperPass, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3a3326d)
#33 0x00000000022de458 llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x22de458)
#34 0x0000000002ccf1d8 (anonymous
namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >) BackendUtil.cpp:0:0
#35 0x0000000002cc8824 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/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x2cc8824)
#36 0x0000000003973250
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3973250)
#37 0x0000000004319de3 clang::ParseAST(clang::Sema&, bool, bool)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x4319de3)
#38 0x00000000032ed5d3 clang::FrontendAction::Execute()
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x32ed5d3)
#39 0x0000000003260b43
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x3260b43)
#40 0x000000000339b692
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x339b692)
#41 0x00000000009dc6e0 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x9dc6e0)
#42 0x00000000009da582 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#43 0x00000000009da224 main
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x9da224)
#44 0x00007f60a80a50b3 __libc_start_main
/build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:342:3
#45 0x00000000009d718e _start
(/home/tuhaoxin/github/llvm-project/build-20210330/bin/clang-13+0x9d718e)
clang-13: error: unable to execute command: Aborted (core dumped)
clang-13: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 13.0.0 (<a href="https://github.com/llvm/llvm-project">https://github.com/llvm/llvm-project</a>
5127da029194bbe32421c336b6f249241b658a2b)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/tuhaoxin/github/llvm-project/build-20210330/bin
clang-13: note: diagnostic msg: 
********************

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

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

$clang -v
clang version 13.0.0 (<a href="https://github.com/llvm/llvm-project">https://github.com/llvm/llvm-project</a>
5127da029194bbe32421c336b6f249241b658a2b)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/tuhaoxin/github/llvm-project/build-20210330/bin
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/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Candidate multilib: .;@m64
Selected multilib: .;@m64


Thanks,
Haoxin</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>