https://llvm.org/bugs/show_bug.cgi?id=30784
Bug ID: 30784 Summary: Reassociate removes call but preserves CG, asserts Product: tools Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: opt Assignee: unassignedb...@nondot.org Reporter: jesper.antons...@ericsson.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 17486 --> https://llvm.org/bugs/attachment.cgi?id=17486&action=edit Reduced ll file exposing the bug The reassociate pass may remove a call and then falsely claim to preserve the CG. This later leads to this assert at dead function removal: opt: ../include/llvm/Analysis/CallGraph.h:184: llvm::CallGraphNode::~CallGraphNode(): Assertion `NumReferences == 0 && "Node deleted while references remain"' failed. One simple fix is to set the variable MadeChange to true in RecursivelyEraseDeadInsts() if operating on a CallInst. (However, the preservation code acting on MadeChange has a comment indicating that even when set to true it should preserve the CG, but currently it does not.) The attached ll-file can be used to provoke the bug using: opt -inline -functionattrs -reassociate reassoc-reduced.ll The attached file originates from our randomised csmith test suite, but was reduced to a minimum before inclusion here. I was unable to reduce the command line to a single pass one. -- 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