https://llvm.org/bugs/show_bug.cgi?id=31095
Bug ID: 31095 Summary: During loop-deletion: Assertion `use_empty() && "Uses remain when a value is destroyed!"' failed. Product: new-bugs Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: new bugs Assignee: unassignedb...@nondot.org Reporter: bjorn.a.petters...@ericsson.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified An assert was triggered when compiling a test case generated using csmith. The test case has been reduced to this: define void @main() { entry: br label %main_loop main_loop: br i1 undef, label %if_target, label %else_target if_target: %tmp = add i32 undef, -1 br label %main_loop else_target: unreachable disconnected_loop: call void @dummy_func(i32 %tmp) br label %disconnected_loop } Can be reproduced by running opt -S -loop-deletion with the above code as input. Output with stack trace using a debug build: While deleting: i32 %tmp Use still stuck around after Def is destroyed: call void @dummy_func(i32 %tmp) opt: ../lib/IR/Value.cpp:85: virtual llvm::Value::~Value(): Assertion `use_empty() && "Uses remain when a value is destroyed!"' failed. #0 0x0000000002b381bf llvm::sys::PrintStackTrace(llvm::raw_ostream&) lib/Support/Unix/Signals.inc:402:5 #1 0x0000000002b386c9 PrintStackTraceSignalHandler(void*) lib/Support/Unix/Signals.inc:466:1 #2 0x0000000002b369b3 llvm::sys::RunSignalHandlers() lib/Support/Signals.cpp:45:5 #3 0x0000000002b38d0e SignalHandler(int) lib/Support/Unix/Signals.inc:256:1 #4 0x00007f54d6809810 __restore_rt (/lib64/libpthread.so.0+0xf810) #5 0x00007f54d59b6755 __GI_raise (/lib64/libc.so.6+0x32755) #6 0x00007f54d59b7d31 __GI_abort (/lib64/libc.so.6+0x33d31) #7 0x00007f54d59af610 __GI___assert_fail (/lib64/libc.so.6+0x2b610) #8 0x00000000024b02e6 llvm::Value::~Value() lib/IR/Value.cpp:89:3 #9 0x000000000232eb15 llvm::User::~User() include/llvm/IR/User.h:91:3 #10 0x00000000023ee653 llvm::Instruction::~Instruction() lib/IR/Instruction.cpp:51:1 #11 0x0000000002409bb5 llvm::BinaryOperator::~BinaryOperator() include/llvm/IR/InstrTypes.h:328:7 #12 0x0000000002409bd9 llvm::BinaryOperator::~BinaryOperator() include/llvm/IR/InstrTypes.h:328:7 #13 0x00000000021da8fe llvm::ilist_alloc_traits<llvm::Instruction>::deleteNode(llvm::Instruction*) include/llvm/ADT/ilist.h:44:49 #14 0x00000000021da8b8 llvm::iplist_impl<llvm::simple_ilist<llvm::Instruction>, llvm::SymbolTableListTraits<llvm::Instruction> >::erase(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, false>) include/llvm/ADT/ilist.h:283:5 #15 0x000000000230949b llvm::iplist_impl<llvm::simple_ilist<llvm::Instruction>, llvm::SymbolTableListTraits<llvm::Instruction> >::erase(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, false>, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, false>) include/llvm/ADT/ilist.h:320:15 #16 0x00000000023083d4 llvm::iplist_impl<llvm::simple_ilist<llvm::Instruction>, llvm::SymbolTableListTraits<llvm::Instruction> >::clear() include/llvm/ADT/ilist.h:324:18 #17 0x0000000002306775 llvm::BasicBlock::~BasicBlock() lib/IR/BasicBlock.cpp:86:1 #18 0x0000000002306839 llvm::BasicBlock::~BasicBlock() lib/IR/BasicBlock.cpp:64:27 #19 0x000000000230928e llvm::ilist_alloc_traits<llvm::BasicBlock>::deleteNode(llvm::BasicBlock*) include/llvm/ADT/ilist.h:44:49 #20 0x0000000002308658 llvm::iplist_impl<llvm::simple_ilist<llvm::BasicBlock>, llvm::SymbolTableListTraits<llvm::BasicBlock> >::erase(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::BasicBlock, true, false, void>, false, false>) include/llvm/ADT/ilist.h:283:5 #21 0x0000000002306926 llvm::BasicBlock::eraseFromParent() lib/IR/BasicBlock.cpp:98:10 #22 0x00000000028c8b65 llvm::LoopDeletionPass::runImpl(llvm::Loop*, llvm::DominatorTree&, llvm::ScalarEvolution&, llvm::LoopInfo&) lib/Transforms/Scalar/LoopDeletion.cpp:199:5 #23 0x00000000028c96d3 (anonymous namespace)::LoopDeletionLegacyPass::runOnLoop(llvm::Loop*, llvm::LPPassManager&) lib/Transforms/Scalar/LoopDeletion.cpp:268:3 #24 0x0000000001d364ea llvm::LPPassManager::runOnFunction(llvm::Function&) lib/Analysis/LoopPass.cpp:201:20 #25 0x0000000002431abd llvm::FPPassManager::runOnFunction(llvm::Function&) lib/IR/LegacyPassManager.cpp:1511:23 #26 0x0000000002431df5 llvm::FPPassManager::runOnModule(llvm::Module&) lib/IR/LegacyPassManager.cpp:1532:16 #27 0x00000000024325de (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) lib/IR/LegacyPassManager.cpp:1588:23 #28 0x00000000024320db llvm::legacy::PassManagerImpl::run(llvm::Module&) lib/IR/LegacyPassManager.cpp:1691:16 #29 0x0000000002432b21 llvm::legacy::PassManager::run(llvm::Module&) lib/IR/LegacyPassManager.cpp:1722:3 #30 0x0000000000a47f9f main tools/opt/opt.cpp:724:3 #31 0x00007f54d59a2c16 __libc_start_main (/lib64/libc.so.6+0x1ec16) #32 0x0000000000a28895 _start /usr/src/packages/BUILD/glibc-2.11.3/csu/../sysdeps/x86_64/elf/start.S:116:0 -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs