[llvm-bugs] [Bug 24773] WinEHPrepare fails on __try / __finally inside __try / __except

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 17 08:04:09 PDT 2015


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

Joseph Tremoulet <JCTremoulet at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |JCTremoulet at gmail.com
         Resolution|---                         |INVALID

--- Comment #3 from Joseph Tremoulet <JCTremoulet at gmail.com> ---
> 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.

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.


> Second, if I run -O1 on the IR, demotion fails like this:

This failure is currently expected for the given input; mismatched nesting can
be legal IR but requires cloning of whole funclets which is NYI.

-- 
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/20150917/6711d8c0/attachment.html>


More information about the llvm-bugs mailing list