https://bugs.llvm.org/show_bug.cgi?id=50874

            Bug ID: 50874
           Summary: [SelectionDAGBuilder] Bad machine code: MBB has
                    duplicate entries in its successor list
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

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. ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to