Forgot to reply all.<div><br></div><div>Duncan suggested that I put the selector call before the store but that didn't help. I get the same assertion failure.</div><div><div><br><div class="gmail_quote">On Thu, Jun 10, 2010 at 2:50 PM, Shivram Khandeparker <span dir="ltr"><<a href="mailto:shivramk@gmail.com">shivramk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">HI Duncan,<br><br><div class="gmail_quote"><div class="im">On Thu, Jun 10, 2010 at 1:58 PM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>an unfortunate weakness of the code generators is that they require calls to</div>
eh.selector to be in a landing pad (landing pad = where an invoke unwinds<br>
to). They can also handle some simple cases when the selector call is outside<br>
the landing pad. In practice, as long as the original call to eh.selector that<br>
you generate is in a landing pad, and at the start of the landing pad (just<br>
after the eh.exception call and any phi nodes) it is intended that the current<br>
logic is good enough to handle any situations caused by optimization. Was the<br>
original call at the start of a landing pad?<br></blockquote><div><br></div></div><div>I am aware of this. All of the landing pads in my original code look like the following</div><div><br></div><div><div>lpad: ; preds = %return7</div>
<div> %46 = call i8* @llvm.eh.exception() ; <i8*> [#uses=2]</div><div> store i8* %46, i8** %22</div><div> %47 = call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %46, i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i8* null) ; <i32> [#uses=0]</div>
<div> br label %destructor</div></div><div><br></div><div>eh.selector always follows the eh.exception call and the store.</div><div class="im"><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
By the way, there are various ways of fixing this codegen problem. But since<br>
there is a plan to redesign exception handling in LLVM, it seems pointless to<br>
spend much time on it.<br></blockquote><div><br></div></div><div>It would be great if you could suggest a workaround till exception handling in LLVM gets redesigned. I would really like to get this working as soon as possible.</div>
<div> </div><div>Regards,</div><div>Shivram</div></div>
</blockquote></div><br></div></div>