[LLVMbugs] [Bug 16189] New: BranchFolder code falls of the beginning of the list.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 31 08:50:43 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16189

            Bug ID: 16189
           Summary: BranchFolder code falls of the beginning of the list.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: micah.villmow at amd.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

// Check all successors to see if we can move this block before it.
      for (MachineBasicBlock::succ_iterator SI = MBB->succ_begin(),
           E = MBB->succ_end(); SI != E; ++SI) {
        // Analyze the branch at the end of the block before the succ.
        MachineBasicBlock *SuccBB = *SI;
        MachineFunction::iterator SuccPrev = SuccBB; --SuccPrev;


This code is incorrect if you branch to the entry block of a function. SuccBB
points to the block with ID0, and --SuccPrev moves before this, triggering the
assertion here:
 /net/pc172/local_disk/mvillmow/swtrunk/llvm/include/llvm/ADT/ilist.h:214:
llvm::ilist_iterator<NodeTy>& llvm::ilist_iterator<NodeTy>::operator--() [with
NodeTy = llvm::MachineBasicBlock, llvm::ilist_iterator<NodeTy> =
llvm::ilist_iterator<llvm::MachineBasicBlock>]: Assertion `NodePtr && "--'d off
the beginning of an ilist!"' failed.

-- 
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/20130531/155788aa/attachment.html>


More information about the llvm-bugs mailing list