[llvm-bugs] [Bug 26147] New: Verify error: Unwind edges out of a funclet pad must have the same unwind dest

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 14 13:56:10 PST 2016


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

            Bug ID: 26147
           Summary: Verify error: Unwind edges out of a funclet pad must
                    have the same unwind dest
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: alex at crichton.co
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

When running the IR below through `opt -inline` it will generate the error

Unwind edges out of a funclet pad must have the same unwind dest
  %pad2.i = cleanuppad within none []
  cleanupret from %pad2.i unwind label %bad1.i
  invoke void @external() [ "funclet"(token %pad2.i) ]
          to label %.noexc unwind label %bad
LLVM ERROR: Broken function found, compilation aborted!

---

; ModuleID = 'foo.ll'
target triple = "x86_64-pc-windows-msvc"

declare i32 @__C_specific_handler(...)

declare void @external()

define void @foo(i8*) personality i32 (...)* @__C_specific_handler {
start:
  invoke void @bar(i8* %0)
          to label %good unwind label %bad

good:                                             ; preds = %start
  ret void

bad:                                              ; preds = %start
  %pad = cleanuppad within none []
  cleanupret from %pad unwind to caller
}

define internal void @bar(i8*) personality i32 (...)* @__C_specific_handler {
start:
  invoke void @external()
          to label %ok1 unwind label %bad1

ok1:                                              ; preds = %start
  invoke void @external()
          to label %ok2 unwind label %bad2

ok2:                                              ; preds = %ok1
  ret void

bad2:                                             ; preds = %ok1
  %pad2 = cleanuppad within none []
  call void @external() [ "funclet"(token %pad2) ]
  cleanupret from %pad2 unwind label %bad1

bad1:                                             ; preds = %bad2, %start
  %pad1 = cleanuppad within none []
  cleanupret from %pad1 unwind to caller
}

-- 
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/20160114/f89ed754/attachment.html>


More information about the llvm-bugs mailing list