[LLVMbugs] [Bug 21898] New: [Inliner][Debug Metadata] Assertion `Val && "isa<> used on a null pointer"'

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Dec 12 10:34:57 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=21898

            Bug ID: 21898
           Summary: [Inliner][Debug Metadata] Assertion `Val && "isa<>
                    used on a null pointer"'
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: mcrosier at codeaurora.org
                CC: apazos at codeaurora.org, llvmbugs at cs.uiuc.edu,
                    mcrosier at codeaurora.org
    Classification: Unclassified

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)

-- 
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/20141212/604629ab/attachment.html>


More information about the llvm-bugs mailing list