<html>
    <head>
      <base href="https://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 - [SelectionDAGBuilder] Bad machine code: MBB has duplicate entries in its successor list"
   href="https://bugs.llvm.org/show_bug.cgi?id=50874">50874</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[SelectionDAGBuilder] Bad machine code: MBB has duplicate entries in its successor list
          </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>Linux
          </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>Common Code Generator Code
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>paulsson@linux.vnet.ibm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>int a;
volatile unsigned b;
short c;
long d;
void e() {
f:
  b;
g:
  if (a)
    ;
  else {
    int h;
    if (d)
      goto f;
    if (c)
      goto g;
  }
}
void main() {}

clang -O3 -march=arch13 -o a.out -w -mllvm -available-load-scan-limit=12 -mllvm
-disable-cgp-branch-opts -mllvm -verify-machineinstrs

# After Instruction Selection
*** Bad machine code: MBB has duplicate entries in its successor list. ***
- function:    e
- basic block: %bb.10 f (0x2aa456acfc8)

or with llc:

define void @e() {
bb:
  switch i32 undef, label %bb1 [
    i32 0, label %bb2
    i32 2, label %bb2
    i32 3, label %bb2
  ]

bb1:                                              ; preds = %bb
  br label %bb2

bb2:                                              ; preds = %bb1, %bb, %bb, %bb
  ret void
}

llc -mcpu=arch13 -O3 -disable-cgp-branch-opts -verify-machineinstrs 

*** Bad machine code: MBB has duplicate entries in its successor list. ***</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>