[llvm-bugs] [Bug 43269] New: After r363529, An asserting value handle still pointed to this value!

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 10 12:35:03 PDT 2019


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

            Bug ID: 43269
           Summary: After r363529, An asserting value handle still pointed
                    to this value!
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dimitry at andric.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

After https://reviews.llvm.org/rL363529 ('Re-commit r357452 (take 3):
"SimplifyCFG SinkCommonCodeFromPredecessors: Also sink function calls without
used results (PR41259)"'), compiling certain kernel modules for FreeBSD crashes
clang with:

> While deleting: i8* %n
> An asserting value handle still pointed to this value!
> UNREACHABLE executed at /home/dim/src/llvm/llvm-project/llvm/lib/IR/Value.cpp:893!

Reduced test case:

// clang -cc1 -triple aarch64-- -S -O1 if_malo_pci-min.c
struct b {
  int c;
  int d;
  int e;
  int ecm;
};
struct f {
  struct b g[1024];
} h(), j;
struct k {
  struct f l;
  void *m[1];
  int n;
};
int o, p;
int q();
void r();
void *s();
int t() {
  int i;
  struct k *a = s();
  if (o)
    goto bad;
  if (a->n)
    q(0, p, 0, h, 0, &j, a->m);
  else
    q(0, p, 0, h, 0, &j, &a->m[i]);
  if (q())
    r();
  if (a->n)
    r(0, p, a->m[0]);
  else
    for (i = 0; i < 1; i++)
      r(0, p, a->m[i]);
bad:
  return 0;
}

Backtrace:

Starting program: /home/dim/obj/clang-363529/bin/clang -cc1 -triple aarch64--
-S -O1 if_malo_pci-min.c
While deleting: i8* %n
An asserting value handle still pointed to this value!
UNREACHABLE executed at
/home/dim/src/llvm/llvm-project/llvm/lib/IR/Value.cpp:893!

Program received signal SIGABRT, Aborted.
thr_kill () at thr_kill.S:3
3       thr_kill.S: No such file or directory.
(gdb) bt
#0  thr_kill () at thr_kill.S:3
#1  0x0000000803dbe934 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52
#2  0x0000000803d31d99 in abort () at /usr/src/lib/libc/stdlib/abort.c:67
#3  0x0000000001d3678d in llvm::llvm_unreachable_internal(char const*, char
const*, unsigned int) ()
#4  0x000000000183992e in llvm::ValueHandleBase::ValueIsDeleted(llvm::Value*)
()
#5  0x0000000001839c6e in llvm::Value::~Value() ()
#6  0x0000000001839ad3 in llvm::Value::deleteValue() ()
#7  0x00000000017c2590 in llvm::Instruction::eraseFromParent() ()
#8  0x0000000001de70ed in
llvm::RecursivelyDeleteTriviallyDeadInstructions(llvm::SmallVectorImpl<llvm::Instruction*>&,
llvm::TargetLibraryInfo const*, llvm::MemorySSAUpdater*) ()
#9  0x0000000001de6b19 in
llvm::RecursivelyDeleteTriviallyDeadInstructions(llvm::Value*,
llvm::TargetLibraryInfo const*, llvm::MemorySSAUpdater*) ()
#10 0x000000000136aaa8 in (anonymous
namespace)::CodeGenPrepare::optimizeMemoryInst(llvm::Instruction*,
llvm::Value*, llvm::Type*, unsigned int) ()
#11 0x0000000001362167 in (anonymous
namespace)::CodeGenPrepare::optimizeInst(llvm::Instruction*, bool&) ()
#12 0x0000000001358c14 in (anonymous
namespace)::CodeGenPrepare::runOnFunction(llvm::Function&) ()
#13 0x00000000017f2e7a in llvm::FPPassManager::runOnFunction(llvm::Function&)
()
#14 0x00000000017f3213 in llvm::FPPassManager::runOnModule(llvm::Module&) ()
#15 0x00000000017f3722 in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
#16 0x0000000001f5dcd0 in clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::__1::unique_ptr<llvm::raw_pwrite_stream,
std::__1::default_delete<llvm::raw_pwrite_stream> >) ()
#17 0x00000000025fae02 in
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) ()
#18 0x0000000002d6a363 in clang::ParseAST(clang::Sema&, bool, bool) ()
#19 0x000000000255c06a in clang::FrontendAction::Execute() ()
#20 0x00000000024d6991 in
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
#21 0x00000000025f4fb5 in
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) ()
#22 0x0000000000f066ec in cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) ()
#23 0x0000000000f040ab in main ()

-- 
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/20190910/6e4976cb/attachment-0001.html>


More information about the llvm-bugs mailing list