<html>
    <head>
      <base href="http://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 - Crash in LoopUnrollPeel"
   href="http://bugs.llvm.org/show_bug.cgi?id=32277">32277</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash in LoopUnrollPeel
          </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>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Loop Optimizer
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>james.molloy@arm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, sanjoy@playingwithpointers.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>After the series of commits by Sanjoy on 3rd March, the following testcase
causes a crash:

target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "armv7r-arm-none-eabi"

define hidden arm_aapcs_vfpcc i32 @test(i32 %j, i32 %k, i32 %recurs) {
entry:
  %cmp = icmp eq i32 %j, 0
  br label %bb2

bb2:                                              ; preds = %entry, %bb12
  %k.addr.0 = phi i32 [ %k.addr.2, %bb12 ], [ %k, %entry ]
  %result.0 = phi i32 [ 20, %bb12 ], [ 0, %entry ]
  br i1 %cmp, label %bb12, label %bb4

bb4:                                              ; preds = %bb12, %bb2
  %k.addr.1 = phi i32 [ %k.addr.0, %bb2 ], [ %k.addr.2, %bb12 ]
  %x.1 = phi i32 [ 0, %bb2 ], [ %x.2, %bb12 ]
  %result.1 = phi i32 [ %result.0, %bb2 ], [ 10, %bb12 ]
  %cmp2 = icmp eq i32 %k.addr.1, 0
  br i1 %cmp2, label %bb13, label %bb12

bb12:                                             ; preds = %bb4, %bb2
  %k.addr.2 = phi i32 [ %k.addr.0, %bb2 ], [ 0, %bb4 ]
  %x.2 = phi i32 [ 1, %bb2 ], [ %x.1, %bb4 ]
  %cmp5 = icmp eq i32 %x.2, 0
  br i1 %cmp5, label %bb2, label %bb4

bb13:                                             ; preds = %bb4
  ret i32 %result.1
}

Run with "opt -O1 test.ll -disable-output":
opt: ../include/llvm/IR/Instructions.h:2715: llvm::Value
*llvm::PHINode::getIncomingValueForBlock(const llvm::BasicBlock *) const:
Assertion `Idx >= 0 && "Invalid basic block argument!"' failed.</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>