<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 - After r357222, Assertion failed: (A->getParent() == B->getParent() && "Instructions must be in the same basic block!"), function dominates, file lib/Analysis/OrderedBasicBlock.cpp, line 68."
   href="https://bugs.llvm.org/show_bug.cgi?id=43417">43417</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>After r357222, Assertion failed: (A->getParent() == B->getParent() && "Instructions must be in the same basic block!"), function dominates, file lib/Analysis/OrderedBasicBlock.cpp, line 68.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>All
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dimitry@andric.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>As reported in <a href="https://bugs.freebsd.org/240765">https://bugs.freebsd.org/240765</a>, compiling the commoncpp port
with clang 9.0.0 results in an assertion:

Assertion failed: (A->getParent() == B->getParent() && "Instructions must be in
the same basic block!"), function dominates, file
/lib/Analysis/OrderedBasicBlock.cpp, line 68.

#0  thr_kill () at thr_kill.S:3
#1  0x0000000804812934 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52
#2  0x0000000804785d99 in abort () at /usr/src/lib/libc/stdlib/abort.c:67
#3  0x00000008048025c1 in __assert (func=<optimized out>, file=<optimized out>,
line=<optimized out>, failedexpr=<optimized out>) at
/usr/src/lib/libc/gen/assert.c:51
#4  0x0000000001d6e6d6 in llvm::OrderedBasicBlock::dominates(llvm::Instruction
const*, llvm::Instruction const*) ()
#5  0x0000000002649878 in eliminateDeadStores(llvm::BasicBlock&,
llvm::AAResults*, llvm::MemoryDependenceResults*, llvm::DominatorTree*,
llvm::TargetLibraryInfo const*) ()
#6  0x0000000002650445 in (anonymous
namespace)::DSELegacyPass::runOnFunction(llvm::Function&) ()
#7  0x000000000231b673 in llvm::FPPassManager::runOnFunction(llvm::Function&)
()
#8  0x00000000020e1b95 in (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&) ()
#9  0x000000000231be62 in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
#10 0x0000000002a643d1 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> >) ()
#11 0x00000000030e6fed in
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) ()
#12 0x00000000038117e3 in clang::ParseAST(clang::Sema&, bool, bool) ()
#13 0x000000000304ab0a in clang::FrontendAction::Execute() ()
#14 0x0000000002fc85c1 in
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
#15 0x00000000030e0dde in
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) ()
#16 0x000000000145c43d in cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) ()
#17 0x000000000145a0db in main ()

This regressed with <a href="https://reviews.llvm.org/rL357222">https://reviews.llvm.org/rL357222</a> (Recommit "[DSE] Preserve
basic block ordering using OrderedBasicBlock"), which was a recommit of
<a href="https://reviews.llvm.org/rL357208">https://reviews.llvm.org/rL357208</a> for <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Quadratic behavior in DSE and memcpyopt from use of callCapturesBefore without an OrderedBasicBlock"
   href="show_bug.cgi?id=38829">bug 38829</a>.

Minimized test case:

// clang -cc1 -triple x86_64-- -S -O1 -fexceptions in6addr-min.cpp
struct a {
  int b[6];
};
extern "C" void *memcpy(void *, void *, long);
struct c {
  a *d;
  int e;
  c();
};
c::c() : e() {
  d = new a;
  memcpy(&d, 0, sizeof(a));
}</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>