[llvm-bugs] [Bug 26263] New: [WinEH] assertion when inlining function into cleanuppad

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jan 22 14:22:28 PST 2016


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

            Bug ID: 26263
           Summary: [WinEH] assertion when inlining function into
                    cleanuppad
           Product: new-bugs
           Version: 3.8
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: r.sagitario at gmx.de
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15696
  --> https://llvm.org/bugs/attachment.cgi?id=15696&action=edit
original IR before reduction by bugpoint

The attached IR produces an assertion when optimized with -O2:

Assertion failed: isa<X>(Val) && "cast<Ty>() argument of incompatible type!",
file C:\s\d\ldc\llvm\include\llvm/Support/Casting.h, line 223

bugpoint reduces this to:

; ModuleID = 'bugpoint-reduced-simplified.bc'
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i386-pc-windows-msvc"

define x86_stdcallcc void @"\01__D5sdt123S126__dtorMFZv"() {
  ret void
}

define x86_stdcallcc void @"\01__D5sdt125foo12FS5sdt123S12Zv"() {
  ret void
}

define x86_stdcallcc void @"\01__D5sdt126test12FZv"() personality i32 (i8*,
i8*, i8*, i8*)* @__CxxFrameHandler3 {
  invoke x86_stdcallcc void @"\01__D5sdt125foo12FS5sdt123S12Zv"()
          to label %postinvoke unwind label %cleanuppad

postinvoke:                                       ; preds = %0
  br i1 undef, label %assertPassed, label %assertFailed

cleanuppad:                                       ; preds = %0
  %1 = cleanuppad within none []
  br i1 undef, label %finally1, label %cleanupret

finally1:                                         ; preds = %cleanuppad
  br label %cleanupret

cleanupret:                                       ; preds = %finally1,
%cleanuppad
  cleanupret from %1 unwind to caller

assertPassed:                                     ; preds = %postinvoke
  ret void

assertFailed:                                     ; preds = %postinvoke
  unreachable
}

declare i32 @__CxxFrameHandler3(i8*, i8*, i8*, i8*)

!llvm.ident = !{!0}

!0 = !{!"ldc version 1598c4"} 

and blames the -prune-eh pass. "opt -prune-eh" prints:

CleanupReturnInst needs to be provided a CleanupPad
  cleanupret from undef unwind to caller
token undef
LLVM ERROR: Broken function found, compilation aborted!

-- 
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/20160122/e94c556d/attachment-0001.html>


More information about the llvm-bugs mailing list