<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:rnk@google.com" title="Reid Kleckner <rnk@google.com>"> <span class="fn">Reid Kleckner</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - WinEHPrepare failed to demote instruction"
   href="https://llvm.org/bugs/show_bug.cgi?id=23884">bug 23884</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - WinEHPrepare failed to demote instruction"
   href="https://llvm.org/bugs/show_bug.cgi?id=23884#c6">Comment # 6</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - WinEHPrepare failed to demote instruction"
   href="https://llvm.org/bugs/show_bug.cgi?id=23884">bug 23884</a>
              from <span class="vcard"><a class="email" href="mailto:rnk@google.com" title="Reid Kleckner <rnk@google.com>"> <span class="fn">Reid Kleckner</span></a>
</span></b>
        <pre>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
}</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>