[llvm-bugs] [Bug 34787] New: Assertion `TN->getNumChildren() == 0 && "Not a tree leaf"'

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 29 18:22:45 PDT 2017


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

            Bug ID: 34787
           Summary: Assertion `TN->getNumChildren() == 0 && "Not a tree
                    leaf"'
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: babokin at gmail.com
                CC: llvm-bugs at lists.llvm.org

clang trunk rev314491, x86_64.

Another assertion in JumpThreadingPass (first one reported in #34782)

> cat f.cpp
template <class a> class b {
public:
  a &operator[](unsigned long);
  a *c;
};
template <typename a> a &b<a>::operator[](unsigned long d) { return c[d]; }
int e, f;
char g, h;
b<int> i, j, k;
void l() {
  if (j[2]) {
    k[1];
    if (f) {
      int n;
      if (g + 3) {
        g ?: k[1];
        i[1];
      } else
        h = 0;
      if (g ? e : k[1] & 90870993)
        int m;
    }
    j[2];
  }
}

> clang++ -std=c++11 -O2 f.cpp -c -w
f.cpp:16:9: warning: expression result unused [-Wunused-value]
        g ?: k[1];
        ^~~~~~~~~
clang-6.0:
/localdisk2/users/dybaboki/llvm/llvm-trunk-20170928/include/llvm/Support/GenericDomTreeConstruction.h:1107:
static void
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::EraseNode(DomTreeT &, const llvm::DomTreeBuilder::SemiN
CAInfo::TreeNodePtr) [DomTreeT = llvm::DominatorTreeBase<llvm::BasicBlock,
false>]: Assertion `TN->getNumChildren() == 0 && "Not a tree leaf"' failed.
#0 0x000000000135465f llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x135465f)
#1 0x0000000001354966 SignalHandler(int)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x1354966)
#2 0x00007fa491a5f5e0 __restore_rt (/lib64/libpthread.so.0+0xf5e0)
#3 0x00007fa4905d91f7 __GI_raise (/lib64/libc.so.6+0x351f7)
#4 0x00007fa4905da8e8 __GI_abort (/lib64/libc.so.6+0x368e8)
#5 0x00007fa4905d2266 __assert_fail_base (/lib64/libc.so.6+0x2e266)
#6 0x00007fa4905d2312 (/lib64/libc.so.6+0x2e312)
#7 0x0000000000eab197
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::EraseNode(llvm::DominatorTreeBase<llvm::BasicBlock, false>&,
llvm::DomTreeNodeBase<llvm::BasicBlock>*)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang
-6.0+0xeab197)
#8 0x0000000000ea95f6
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::DeleteUnreachable(llvm::DominatorTreeBase<llvm::BasicBlock, false>&,
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::BatchUpda
teInfo*, llvm::DomTreeNodeBase<llvm::BasicBlock>*)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0xea95f6)
#9 0x0000000000e93fdc
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::DeleteEdge(llvm::DominatorTreeBase<llvm::BasicBlock, false>&,
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::BatchUpdateInfo*
, llvm::BasicBlock*, llvm::BasicBlock*)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0xe93fdc)
#10 0x0000000000eadb51
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::ApplyNextUpdate(llvm::DominatorTreeBase<llvm::BasicBlock, false>&,
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::BatchUpdat
eInfo&)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0xeadb51)
#11 0x0000000000e94ccb
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::ApplyUpdates(llvm::DominatorTreeBase<llvm::BasicBlock, false>&,
llvm::ArrayRef<llvm::DomTreeBuilder::Update<llvm::BasicBlock*> >)
(/localdisk2/users/dybaboki/llvm/
bin-trunk-20170928/bin/clang-6.0+0xe94ccb)
#12 0x00000000013a7c9e llvm::MergeBasicBlockIntoOnlyPred(llvm::BasicBlock*,
llvm::DominatorTree*)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x13a7c9e)
#13 0x00000000011b8353 llvm::JumpThreadingPass::ProcessBlock(llvm::BasicBlock*)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x11b8353)
#14 0x00000000011b7a7b llvm::JumpThreadingPass::runImpl(llvm::Function&,
llvm::TargetLibraryInfo*, llvm::LazyValueInfo*, llvm::AAResults*,
llvm::DominatorTree*, bool, std::unique_ptr<llvm::BlockFrequencyInfo,
std::default_delete<llvm::BlockFrequencyInfo> >, std::unique_pt
r<llvm::BranchProbabilityInfo, std::default_delete<llvm::BranchProbabilityInfo>
>) (/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x11b7a7b)
#15 0x00000000011c3e0f (anonymous
namespace)::JumpThreading::runOnFunction(llvm::Function&)
(/localdisk2/users/dybaboki/llvm/bin-trunk-20170928/bin/clang-6.0+0x11c3e0f)
<...>

-- 
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/20170930/ec3575c3/attachment-0001.html>


More information about the llvm-bugs mailing list