<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Dec 18, 2016 at 11:58 PM, Jonas Maebe <span dir="ltr"><<a href="mailto:jonas-devlists@watlock.be" target="_blank">jonas-devlists@watlock.be</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Actually, there's another —even more fundamental— problem: the longjmp<br>
will always restore the non-volatile registers to the contents they had<br>
at the start of the try-block, which is not what LLVM expects when<br>
entering an SEH-based landing pad.<br></blockquote><div><br></div><div>The SjLjEHPrepare pass tries to deal with this by demoting all values live across EH edges to the stack. This should also eliminate those phis from landingpad blocks. Check out TargetPassConfig::addPassesToHandleExceptions() and make sure you run that pass.</div></div></div></div>