<html>
    <head>
      <base href="https://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 --- - Assertion failure: use_empty() && "Uses remain when a value is destroyed!""
   href="https://llvm.org/bugs/show_bug.cgi?id=25299">25299</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failure: use_empty() && "Uses remain when a value is destroyed!"
          </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>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>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>alex@crichton.co
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When running `opt -O2` over the bytecode attached here, this assertion is
generated:

While deleting: { i8*, i32 } %
Use still stuck around after Def is destroyed:  %eh.lpad-body = phi { i8*, i32
} [ <badref>, %next.i.i.i.i ], [ <badref>, %unwind_custom_.i.i ], [ %20,
%next.i.i.i.18.i ], [ %20,
%"_ZN41collections..vec..Vec$LT$ast..TyParam$GT$10drop.5810217h641412e555c9adeeE.exit.i"
], [ %20,
%"_ZN41collections..vec..Vec$LT$ast..TyParam$GT$10drop.5810217h641412e555c9adeeE.exit.i"
], [ %20, %clean_custom_.i ]
Use still stuck around after Def is destroyed:  %eh.lpad-body = phi { i8*, i32
} [ <badref>, %next.i.i.i.i ], [ <badref>, %unwind_custom_.i.i ], [ %20,
%next.i.i.i.18.i ], [ %20,
%"_ZN41collections..vec..Vec$LT$ast..TyParam$GT$10drop.5810217h641412e555c9adeeE.exit.i"
], [ %20,
%"_ZN41collections..vec..Vec$LT$ast..TyParam$GT$10drop.5810217h641412e555c9adeeE.exit.i"
], [ %20, %clean_custom_.i ]
opt: ../../../../src/llvm/lib/IR/Value.cpp:82: virtual llvm::Value::~Value():
Assertion `use_empty() && "Uses remain when a value is destroyed!"' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff6e09cc9 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
56      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff6e09cc9 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff6e0d0d8 in __GI_abort () at abort.c:89
#2  0x00007ffff6e02b86 in __assert_fail_base (fmt=0x7ffff6f53830 "%s%s%s:%u:
%s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x18ae888 "use_empty() && \"Uses remain when a
value is destroyed!\"", file=file@entry=0x18ae0a8
"../../../../src/llvm/lib/IR/Value.cpp", line=line@entry=82, 
    function=function@entry=0x21a3cc0
<llvm::Value::~Value()::__PRETTY_FUNCTION__> "virtual llvm::Value::~Value()")
at assert.c:92
#3  0x00007ffff6e02c32 in __GI___assert_fail (assertion=0x18ae888 "use_empty()
&& \"Uses remain when a value is destroyed!\"", file=0x18ae0a8
"../../../../src/llvm/lib/IR/Value.cpp", line=82, 
    function=0x21a3cc0 <llvm::Value::~Value()::__PRETTY_FUNCTION__> "virtual
llvm::Value::~Value()") at assert.c:101
#4  0x000000000170eb9f in llvm::Value::~Value() ()
#5  0x00000000016c0a87 in llvm::LandingPadInst::~LandingPadInst() ()
#6  0x00000000015c87dc in llvm::BasicBlock::~BasicBlock() ()
#7  0x00000000015c8909 in llvm::BasicBlock::~BasicBlock() ()
#8  0x00000000015c6fd2 in llvm::BasicBlock::eraseFromParent() ()
#9  0x0000000001337685 in (anonymous
namespace)::SimplifyCFGOpt::SimplifyResume(llvm::ResumeInst*,
llvm::IRBuilder<true, llvm::ConstantFolder,
llvm::IRBuilderDefaultInserter<true> >&) [clone .isra.757]
    ()
#10 0x0000000001341bc3 in llvm::SimplifyCFG(llvm::BasicBlock*,
llvm::TargetTransformInfo const&, unsigned int, llvm::AssumptionCache*) ()
#11 0x00000000011e417a in simplifyFunctionCFG(llvm::Function&,
llvm::TargetTransformInfo const&, llvm::AssumptionCache*, int) ()
#12 0x00000000016e6bc3 in llvm::FPPassManager::runOnFunction(llvm::Function&)
()
#13 0x00000000013fd3c0 in (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&) ()
#14 0x00000000016e728f in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
#15 0x0000000000604082 in main ()


We ended up finding this when trying to upgrade from LLVM 3.7 to the current
trunk, and I tried running bugpoint over the bytecode but it unfortunately
didn't do too well about minimizing it. If you need any more info though please
just let me know!</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>