[llvm-bugs] [Bug 23884] WinEHPrepare failed to demote instruction

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Oct 21 11:39:49 PDT 2015


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

Reid Kleckner <rnk at google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Reid Kleckner <rnk at google.com> ---
This works in the new approach to EH. This was the IR I used:
target triple = "x86_64-pc-windows-msvc"

declare i32 @__C_specific_handler(...)
declare void @bar()
declare void @baz()
declare void @free(i8*)

define void @foo() personality i32 (...)* @__C_specific_handler {
  invoke void @baz()
          to label %normal unwind label %unwind1

normal:
  unreachable

unwind1:
  %p = cleanuppad []
  %rem = load i8*, i8** undef, align 8
  invoke void @bar()
          to label %normal unwind label %unwind2

unwind2:
  %p2 = cleanuppad []
  invoke void @baz()
          to label %normal2 unwind label %unwind3

normal2:
  call void @free(i8* %rem)
  unreachable

unwind3:
  %p3 = cleanuppad []
  unreachable
}

-- 
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/20151021/723e52e5/attachment.html>


More information about the llvm-bugs mailing list