<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - [Inliner][Debug Metadata] Assertion `Val && "isa<> used on a null pointer"'"
   href="http://llvm.org/bugs/show_bug.cgi?id=21898">21898</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Inliner][Debug Metadata] Assertion `Val && "isa<> used on a null pointer"'
          </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>mcrosier@codeaurora.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>apazos@codeaurora.org, llvmbugs@cs.uiuc.edu, mcrosier@codeaurora.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Test case:
---------------------------------------
int flags;

char *bar(char *b, int c, int e, int d) {
  char *ptr = b + (sizeof(char) + 2);
  int s;
  if (d)
    s = 0;
  else if (c >= 0) {
    e = c;
    s = 1;
  }
  while (e /= 2);
  if (s)
    *--ptr = '-';
}
char * foo(struct sv *sv, int flags) {
  if (flags) {
    char b[1];
    if (flags)
      bar(b, 0, 0, 1);
    else
      bar(b, 0, 0, 0);
  }
}
---------------------------------------

Reproduce with:
/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6
-cc1 -triple aarch64--linux-gnu -emit-obj -disable-free -main-file-name test.i
-mrelocation-model static -mthread-model posix -mdisable-fp-elim -relaxed-alia
sing -fmath-errno -masm-verbose -mconstructor-aliases -fuse-init-array
-target-cpu cortex-a53 -target-feature +neon -target-feature +crc
-target-feature +crypto -target-abi aapcs -g -dwarf-column-info -coverage-file
/prj/llvm-arm/home/mrosier/sv.o -resource-dir
/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/../lib/clang/3.6.0
-O2 -w -fdebug-compilation-dir /prj/llvm-arm/home/mrosier -ferror-limit 19
-fmessage-length 0 -mstackrealign -fallow-half-arguments-and-returns
-fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -vectorize-loops
-vectorize-slp -o sv.o -x cpp-output test.i


Backtrace:
---------------------------------------
clang-3.6:
/prj/llvm-arm/home/nightly/src/community-mainline/llvm/include/llvm/Support/Casting.h:95:
static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To =
llvm::MDNode; From = llvm::Metadata]: Assertion `Val && "isa<> used on a null
pointer"' f
ailed.
#0 0x100b842 llvm::sys::PrintStackTrace(_IO_FILE*)
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0x100b842)
#1 0x1009a31 SignalHandler(int)
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0x1009a31)
#2 0x7f0b64ecd8f0 __restore_rt (/lib/libpthread.so.0+0xf8f0)
#3 0x7f0b641abb25 gsignal
/build/buildd/eglibc-2.11.1/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:64:0
#4 0x7f0b641af670 abort /build/buildd/eglibc-2.11.1/stdlib/abort.c:94:0
#5 0x7f0b641a49f1 __assert_fail
/build/buildd/eglibc-2.11.1/assert/assert.c:81:0
#6 0xd33cb5
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0xd33cb5)
#7 0xd33ce2 llvm::MetadataTracking::track(void*, llvm::Metadata&,
llvm::PointerUnion<llvm::MetadataAsValue*, llvm::Metadata*>)
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0xd33ce2)
#8 0xd30c73 llvm::ReplaceableMetadataImpl::replaceAllUsesWith(llvm::Metadata*)
[clone .part.340]
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0xd30c73)
#9 0xd314ee llvm::ValueAsMetadata::handleDeletion(llvm::Value*)
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0xd314ee)
#10 0xd4ac40 llvm::Value::~Value()
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0xd4ac40)
#11 0xd090a7 llvm::GetElementPtrInst::~GetElementPtrInst()
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0xd090a7)
#12 0x100fd2c llvm::DeleteDeadBlock(llvm::BasicBlock*)
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0x100fd2c)
#13 0x1023db2 llvm::CloneAndPruneFunctionInto(llvm::Function*, llvm::Function
const*, llvm::ValueMap<llvm::Value const*, llvm::WeakVH,
llvm::ValueMapConfig<llvm::Value const*, llvm::sys::SmartMutex<false> > >&,
bool, llvm::SmallVectorImpl<llvm::ReturnInst*>&, char co
nst*, llvm::ClonedCodeInfo*, llvm::DataLayout const*, llvm::Instruction*)
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0x1023db2)
#14 0x10341e3 llvm::InlineFunction(llvm::CallSite, llvm::InlineFunctionInfo&,
bool)
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0x10341e3)
#15 0xd9916d InlineCallIfPossible(llvm::CallSite, llvm::InlineFunctionInfo&,
llvm::DenseMap<llvm::ArrayType*, std::vector<llvm::AllocaInst*,
std::allocator<llvm::AllocaInst*> >, llvm::DenseMapInfo<llvm::ArrayType*>,
llvm::detail::DenseMapPair<llvm::ArrayType*, std::v
ector<llvm::AllocaInst*, std::allocator<llvm::AllocaInst*> > > >&, int, bool,
llvm::DataLayout const*)
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0xd9916d)
#16 0xd9b24f llvm::Inliner::runOnSCC(llvm::CallGraphSCC&)
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0xd9b24f)
#17 0x16a7549 (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&)
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0x16a7549)
#18 0xd283dd llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0xd283dd)
#19 0x1412b58 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions
const&, llvm::StringRef, llvm::Module*, clang::BackendAction,
llvm::raw_ostream*) (/prj/llvm-arm/home/nightly/install/commu
nity-mainline/cross/2014-12-10/bin/clang-3.6+0x1412b58)
#20 0x1404b5c clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0x1404b5c)
#21 0x18ff383 clang::ParseAST(clang::Sema&, bool, bool)
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0x18ff383)
#22 0x140586b clang::CodeGenAction::ExecuteAction()
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0x140586b)
#23 0x1189236 clang::FrontendAction::Execute()
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0x1189236)
#24 0x1168609 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0x1168609)
#25 0x1212dde clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0x1212dde)
#26 0x69c278 cc1_main(llvm::ArrayRef<char const*>, char const*, void*)
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0x69c278)
#27 0x67bdbe main
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0x67bdbe)
#28 0x7f0b64196c4d __libc_start_main
/build/buildd/eglibc-2.11.1/csu/libc-start.c:258:0
#29 0x697d39 _start
(/prj/llvm-arm/home/nightly/install/community-mainline/cross/2014-12-10/bin/clang-3.6+0x697d39)</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>