<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:JCTremoulet@gmail.com" title="Joseph Tremoulet <JCTremoulet@gmail.com>"> <span class="fn">Joseph Tremoulet</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - WinEHPrepare fails on __try / __finally inside __try / __except"
   href="https://llvm.org/bugs/show_bug.cgi?id=24773">bug 24773</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;">CC</td>
           <td>
                
           </td>
           <td>JCTremoulet@gmail.com
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - WinEHPrepare fails on __try / __finally inside __try / __except"
   href="https://llvm.org/bugs/show_bug.cgi?id=24773#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - WinEHPrepare fails on __try / __finally inside __try / __except"
   href="https://llvm.org/bugs/show_bug.cgi?id=24773">bug 24773</a>
              from <span class="vcard"><a class="email" href="mailto:JCTremoulet@gmail.com" title="Joseph Tremoulet <JCTremoulet@gmail.com>"> <span class="fn">Joseph Tremoulet</span></a>
</span></b>
        <pre><span class="quote">> First, having a single-BB catch funclet seems to confuse WinEHPrepare. It ends up cloning
> the subsequent blocks and transforms the "implausible" ret as unreachable.</span >

WinEHPrepare is working as expected here given its input, the invoke in the
__finally has an unwind edge directly to the catchpad for the __except, which
indicates the __except being nested inside the __finally (contrary to the
actual nesting at source).  To reflect the correct nesting, the IR should be
generated with the invoke's unwind edge targeting a cleanupendpad for the
__finally.  Clang was updated to use cleanupendpad in r247349.


<span class="quote">> Second, if I run -O1 on the IR, demotion fails like this:</span >

This failure is currently expected for the given input; mismatched nesting can
be legal IR but requires cloning of whole funclets which is NYI.</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>